We are attempting to programmatically create Service Requests in our Jira Service Management project (Project Key: [YOUR_JIRA_PROJECT_KEY], Service Desk ID: [YOUR_JIRA_SERVICE_DESK_ID]) using the Python jira library (official Jira Python client).
Our Goal:
We need to automate the creation of Service Requests with a specific Request Type within our Jira Service Management project. For example, we have a Request Type named '[YOUR_REQUEST_TYPE_NAME, e.g., MDC]' (Request Type ID: [YOUR_REQUEST_TYPE_ID, if you found it, e.g., from API script output]).
What We Have Tried and What is Working:
- We are successfully connecting to our Jira instance using basic authentication (username/password) with the Python
jira library. - We can programmatically create basic Jira issues in the target JSM project. These issues are created with the correct Project and Issue Type ("Service Request" or "[System] Service request").
- However, when we attempt to set the Request Type during issue creation using the
serviceDeskId and requestTypeName (or requestTypeId) parameters in the jira.create_issue() method, the issue is created successfully, but the specified Request Type is not applied to the newly created issue. It defaults to a generic Service Request without the specific Request Type we intended.
The Problem/Challenge:
Despite including the serviceDeskId and requestTypeName (or requestTypeId) parameters in our jira.create_issue() call, the Request Type is consistently not being applied. We have tried:
- Using the Request Type Name
- Using the Request Type ID
- Ensuring the correct
serviceDeskId for our JSM project is being used. - Verifying that the user account we are using for API access has "Create Issues" permissions in the target project and appropriate Customer Permissions in the JSM project.
We are using the following structure in our Python code for issue creation (simplified example):
from jira import JIRAa # ... (Jira connection setup with basic_auth) ... issue_dict = { 'project': {'key': '[YOUR_JIRA_PROJECT_KEY]'}, 'issuetype': {'name': '[System] Service request'}, # or 'Service Request' 'summary': 'Test Service Request Creation with Request Type', 'description': 'Programmatic test...', } new_issue = jira.create_issue( fields=issue_dict, serviceDeskId='[YOUR_SERVICE_DESK_ID]', requestTypeName='[YOUR_REQUEST_TYPE_NAME]' # OR requestTypeId='[YOUR_REQUEST_TYPE_ID]' )