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

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')

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events