File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ # coding=utf-8
2+ from atlassian import Jira
3+
4+ # This example shoes how to add an additional value to the Labels field
5+ # without loosing the previously defined ones already defined
6+
7+ issue_key = "TST-1"
8+ new_tag = "label_to_add_for_test"
9+ jira = Jira (url = "http://localhost:8080" , username = "admin" , password = "admin" )
10+
11+
12+ def jira_add_label (issue_key , new_tag ):
13+ field_name = "labels"
14+ # get value and save
15+ field_value = jira .issue_field_value (issue_key , field_name )
16+ field_value .append (new_tag )
17+ # prepare data like this
18+ # https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-edit-issues-6291632
19+ field_preparation = {field_name : field_value }
20+ # update custom field on destination issue
21+ jira .update_issue_field (issue_key , field_preparation )
22+
23+
24+ jira_add_label (issue_key , new_tag )
You can’t perform that action at this time.
0 commit comments