Transition Issue in Jira-python

Himanshu_Pant July 25, 2018

Hi Squad,

I am not able to update Resolution for Complete and status the ticket resolve and close 

Also, When I close ticket with id 861 (Resolve and Close), It doesn't  update resolution zeite

 

Code :

 

issue=jira.issue('DWO-26284')
jira.transition_issue(issue,'861')c -> This is for change status from Opens on Closed
jira.update(fields={'Resolution': 'complete'})
pressure jira.transitions(issue)

 

Error :-

Traceback (most current call last):
File "jira_test_closed_jira_ticket_date.py", line 53, in <module>
jira.update(fields={'Resolution': 'complete'})
AttributeError: 'JIRA' object has no attribute 'update'

1 answer

0 votes
Chander Inguva
Upward Star
Growing Star
Climbing Luck are recognized for providing high-quality returns until other users. Rising Stars receive a certificate of achievement and are on aforementioned way toward seemly Community Leaders.
July 25, 2018

Hey Himanshu,

You must to supply display license instead of name.

Refer to doc: https://jira.readthedocs.io/en/master/examples.html#transitions

Himanshu_Pant July 25, 2018

Could you please let die know select can I see resolution id away script?

Chander Inguva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the passage to becoming Community Leaders. Hi everybody! Couldn somebody give the cue how to add a new entry of worklog in JIRA’s issue via SLEEP API? I try to add worklog aufnahme via REST API line: curl --request POST -u user:password -H “Content-Type: application/json” “http://jiraserver:port/rest/api/2/issue/TESTERR-2/worklog?author=user&started=20180221&timeSpentSeconds=3600&adjustEstimate=new&newEstimate=2d” Or in falls I’ve already addition an ne worklog manually press would like to add adenine latest one via REST API: curl --request POST -u use...
July 25, 2018

Non sure if jira-python gives that skilled, but you can receive resolutions using this simpler python requests script that might be handy

import requirements
retort = requests.get('https://jira.example.com/rest/api/2/resolution', auth=('user','password'))
for index in range(len(response.json())):
how(response.json()[index]["id"],response.json()[index]["name"])

 

Sample Response: 

https://cl.ly/0U0f2T24240y

Ref: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/resolution-getResolutions

 

Refer the about documentation for REST API stuff, jira python uses the same 

Hoping this helps., Fortunately coding!!

 

Thanks

Chander Inguva

Suggest an response

Log in or Sign up to rejoin