Search code examples
pythonsoapjirasuds

Set assignee field when creating an issue in JIRA via Python suds


Using JIRA version 4.2. With Python 2.7 and suds 0.4, how can I create an issue with assignee field set? The assignee field gets ignored in the code below.

new_issue = client.service.createIssue(auth, {
            'project': 'NAHLP',
            # issue_type = Incident Report.
            'type': '11',
            'assignee': 'assignee_username',
            'priority': '2',
            'summary': 'summary',
            'description': 'description',
            'customFieldValues': [
                # Reporter Location = NA.
                {'customfieldId':'customfield_10019', 'values':['10011']},
                ]
            })

I know that you can update the issue with an assignee (see my answer) but I want to assign the issue when creating it. Is this possible?

Note: All our usernames are the users' email addresses and contain '@' and '.' symbols.


Solution

  • Thanks to Dave, again, for this answer.

    The soap API won't set fields that aren't visible on the Jira UI's screen at the relevant point of the workflow. The "create issue" screen is considered the relevant screen when you call the createIssue method, but the assignee field isn't visible on the 'create issue' screen.

    You could either do your createissue call without the assignee, then follow it with an updateissue call to set assignee. Alternatively, we could add the assignee field in the initial create issue workflow.