| |
@@ -491,14 +491,13 @@
|
| |
|
| |
def _change_status(client, downstream, status, issue):
|
| |
"""
|
| |
- Change status of JIRA issue
|
| |
- Args:
|
| |
- client (jira.client.JIRA): JIRA client
|
| |
- downstream (jira.resources.Issue): JIRA issue object
|
| |
- status (str): Title of status to which issue should be move
|
| |
- issue (sync2jira.intermediary.Issue): Issue object
|
| |
- Returns:
|
| |
- Nothing
|
| |
+ Change status of JIRA issue.
|
| |
+
|
| |
+
|
| |
+ :param jira.client.JIRA client: JIRA client
|
| |
+ :param jira.resources.Issue downstream: JIRA issue object
|
| |
+ :param String status: Title of status to which issue should be move
|
| |
+ :param sync2jira.intermediary.Issue issue: Issue object
|
| |
"""
|
| |
transitions = client.transitions(downstream)
|
| |
id = ''
|
| |
@@ -565,6 +564,17 @@
|
| |
log.info(" Creating issue.")
|
| |
downstream = client.create_issue(**kwargs)
|
| |
|
| |
+ # Add QA field if present
|
| |
+ if issue.downstream.get('qa-contact', None):
|
| |
+ # Fetch all fields
|
| |
+ all_fields = jira.fields()
|
| |
+ # Make a map from field name -> field id
|
| |
+ name_map = {field['name']: field['id'] for field in all_fields}
|
| |
+ # Try to get and update the custom field
|
| |
+ custom_field = name_map.get('QA Contact', None)
|
| |
+ if custom_field:
|
| |
+ downstream.update({custom_field: issue.downstream.get('qa-contact')})
|
| |
+
|
| |
remote_link = dict(url=issue.url, title=remote_link_title)
|
| |
_attach_link(client, downstream, remote_link)
|
| |
|
| |
As requested in issue #89 https://pagure.io/sync-to-jira/issue/89