-3

I'm automating some ticket creations in Jira. It's working fine for the most part, but its not being assigned to the correct user. All the tickets created get created with "unassigned" as the assignee. Everything else works as expected.

Here's what I'm using:

# Jira API Configuration ###

JIRA_SERVER = "https://mycompanyname.atlassian.net"

JIRA_USER_EMAIL = "[email protected]"

JIRA_API_TOKEN = "PROPER_API_TOKEN_XY9ACiVnKDKog8hTa_l5k=856316AB_PROPER_API_TOKEN"

JIRA_PROJECT_KEY = "CorrectProjectKey"

JIRA_ASSIGNEE_EMAIL = "[email protected]"



# ### Ticket Details ###

OUTPUT_FIX_VERSION = "1.0.8" 

OUTPUT_ISSUE_TYPE = "Task"
issue_dict = {
            'project': {'key': JIRA_PROJECT_KEY},
            'summary': ticket_title,
            'description': ticket_description,
            'issuetype': {'name': OUTPUT_ISSUE_TYPE},
            'assignee': {'emailAddress': JIRA_ASSIGNEE_EMAIL},
            'fixVersions': [{'name': OUTPUT_FIX_VERSION}]
        }

What is the issue? Am I using wrong key words in the API configuration? I have checked the project setting in Jira and my user is assigned as a lead. When I create a ticket manually, By default it says "Automatic", but my user is in the drop down of the assignee list and I can select it.

1 Answer 1

2

You can check https://community.atlassian.com/forums/Jira-questions/Assignee-set-to-unassigned-while-creating-ticket-through-the/qaq-p/1310631 for more details, but here's the basic:

Need to use 'assignee': {'id': JIRA_ASSIGNEE_ACCOUNT_ID}, instead of email. It needs the Jira Account ID of the user.

To get the account id:

  1. Go to your Jira site.

  2. Click on your profile picture.

  3. Click on Profile.

  4. Look at the URL in your browser's address bar. It will look like this: https://mycompanyname.atlassian.net/jira/people/123456:a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8

    "123456:a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" This is your account ID.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.