The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble adding comment to resolution when closing issue via python api

Richard Cirone Jr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 20, 2022

Attempting to edit a GitHub->Jira action to work with our Jira setup.  We require a comment and a resolution when attempting to force close an issue.    So here's what I've attempted

 

jira.transition_issue(issue, '91', fields={ 'resolution':{'name': 'Done'}})

since the comment is not there, the error will be that a comment is required:

response text = {"errorMessages":["A comment is required to edit this item!"],"errors":{}}
So we add the comment:
jira.transition_issue(issue, '91', fields={ 'resolution':{'name': 'Done'}, 'comment':{'body': 'Transition comment'}})
but we get this error:
response text = {"errorMessages":[],"errors":{"comment":"Field does not support update 'comment'"}}

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Richard Cirone Jr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 20, 2022

Found API definition for transition_issue... specifies that comment is a optional param. duh.

SO this works: 

jira.transition_issue(issue, '91', fields={ 'resolution':{'name': 'Done'}}, comment='the comment')
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events