I am trying to update the status of issue from 'Request Info' state to 'Submitted' via rest API in python.
after digging a lot in the documentation , I ran a Rest call to get the allowed status for the issue ID and i can see that the status 'Submitted' is allows:
"expand": "transitions",
"transitions": [{
"id": "381",
"name": "Resubmit",
"to": {
"self": "https://ies-valor-jira.ies.mentorg.com/rest/api/2/status/10000",
"description": "",
"iconUrl": "https://ies-valor-jira.ies.mentorg.com/",
"name": "Submitted",
"id": "10000",
"statusCategory": {
"self": "https://ies-valor-jira.ies.mentorg.com/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
So now i would like to change the status with the following code:
from jira import JIRA
JIRA_SERVER = "https://ies-valor-jira.ies.mentorg.com/"
jira_user_name = "myuser"
jira_password = "mypassword!"
jira_connection = JIRA(basic_auth=(jira_user_name, jira_password),
server=JIRA_SERVER)
jira.Issue='SF-6831'
jira_connection.add_comment(jira.Issue, body="Resubmit issues")
jira_connection.transition_issue("SF-6831", "Resubmit")
But i get an error message that indicate :customfield_10509":"You must define "Resubmit Note: before you moving to "CCB Review" state"}
this error is expected because this field is mandatory and it must be filled with a reason for the status change so i need to know how to update this custom field in the Rest call to allow the issue to change status.
I tried to use add.command function but i don't know where i should specify the field name. or is there a different way to do it.
Thanks.
I do most of this work in straight Python using the API, I have a lot of what you need in this repo - https://github.com/dren79/JiraScripting_public I'll add a transition function in the helpers file now. Let me know if it helps!