Hi
I am trying to create an issue in JIRA using Python code.
All is working fine (issue is created) except the assignee field is not being populated.
I am not getting any error when running it.
I assume I am doing something wrong but no idea what.
Any help is appreciated
assignee = 'Dror Paz'
jira_task = jira.create_issue(fields=ticket)
ticket = {
'project': {'key': project_key},
'summary': summary,
'description': description,
'customfield_11277': recommendations,
'issuetype': {'name': issue_type},
'components': components,
'priority': {'name': priority},
'assignee': {'assignee': assignee},
'customfield_10702': qualys_key,
}
I tried:
'assignee': {'name': assignee},
Where assignee was either a name or a user id. Both did not work.
What did work is:
"assignee": {"id": [atlassian user id]},
I got this from the REST API documentation.
Hi @Dror Paz ,
you should change the row:
'assignee': {'assignee': assignee},
with this:
'assignee': {'name': assignee},
and set assignee with your username.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrea.
Thanks for that.
I did fix that and still seeing the same results.
The assignee is NOT updated.
One more thing. - When I remove the assignee from the ticket dictionary, the tickets are created with myself as the assignee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dror Paz ,
it's strange because I tested my code and it worked.
However, to find the assignee id, you could call the rest api:
/rest/api/2/user?username=your_assignee_username
From response, look the key; it should be somethink like: JIRA... The number is your assigneeID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried:
https://[org api]/wiki/rest/api/rest/api/2/user?username=Craig%20Anderson'
But got a 404 error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have ran into this before, I believe the assignee needs to be the assignee id, not the assignee name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the Confluence REST API:
[base url]/user/bulk/migration?username=Craig&username=Anderson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.