From 4665971a94d2000f75a9a76b2db2d288d822a7c8 Mon Sep 17 00:00:00 2001 From: ytjohn Date: Tue, 19 Nov 2019 13:19:10 -0500 Subject: [PATCH 1/3] Add update_field_value action --- actions/update_field_value.py | 14 ++++++++++++++ actions/update_field_value.yaml | 27 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 actions/update_field_value.py create mode 100644 actions/update_field_value.yaml diff --git a/actions/update_field_value.py b/actions/update_field_value.py new file mode 100644 index 0000000..6388af0 --- /dev/null +++ b/actions/update_field_value.py @@ -0,0 +1,14 @@ +from lib.base import BaseJiraAction + +__all__ = [ + 'UpdateFieldValue' +] + + +class AddFieldValue(BaseJiraAction): + def run(self, issue_key, field, value, notify): + + issue = self._client.issue(issue_key) + issue.update(fields={field: value}, notify=notify) + result = issue.fields.labels + return result diff --git a/actions/update_field_value.yaml b/actions/update_field_value.yaml new file mode 100644 index 0000000..0f60cfe --- /dev/null +++ b/actions/update_field_value.yaml @@ -0,0 +1,27 @@ +--- +name: update_field_value +runner_type: python-script +description: Update a field in a particular JIRA issue. +enabled: true +entry_point: update_field_value.py +parameters: + issue_key: + type: string + description: Issue key (e.g. PROJECT-1000). + required: true + field: + type: string + description: the field name. + required: true + value: + type: string + description: the field text itself. + required: true + notify: + type: boolean + description: jira will send notifications (default is true) + default: true + required: false + + + From 0ddc1233325513976bc489a849a20dfe4da47d86 Mon Sep 17 00:00:00 2001 From: ytjohn Date: Tue, 19 Nov 2019 13:46:34 -0500 Subject: [PATCH 2/3] yaml linting --- actions/update_field_value.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/actions/update_field_value.yaml b/actions/update_field_value.yaml index 0f60cfe..e71bf02 100644 --- a/actions/update_field_value.yaml +++ b/actions/update_field_value.yaml @@ -22,6 +22,3 @@ parameters: description: jira will send notifications (default is true) default: true required: false - - - From 3085200e25318fe6871af78261bbea1b3fbc8ae5 Mon Sep 17 00:00:00 2001 From: ytjohn Date: Wed, 20 Nov 2019 10:08:01 -0500 Subject: [PATCH 3/3] linting fixes --- actions/update_field_value.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/actions/update_field_value.py b/actions/update_field_value.py index 6388af0..984b7b0 100644 --- a/actions/update_field_value.py +++ b/actions/update_field_value.py @@ -5,9 +5,8 @@ ] -class AddFieldValue(BaseJiraAction): +class UpdateFieldValue(BaseJiraAction): def run(self, issue_key, field, value, notify): - issue = self._client.issue(issue_key) issue.update(fields={field: value}, notify=notify) result = issue.fields.labels