Hi Team,
I am not able to update Resolution as Complete and status of ticket resolve and close
Also, When I close ticket with id 861 (Resolve and Close), It doesn't update resolution time
Code :
issue=jira.issue('DWO-26284')
jira.transition_issue(issue,'861')c -> This is to change status from Open to Closed
jira.update(fields={'Resolution': 'complete'})
print jira.transitions(issue)
Error :-
Traceback (most recent 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'
Hey Himanshu,
You need to provide resolution id instead of name.
Refer to doc: https://jira.readthedocs.io/en/master/examples.html#transitions
Could you please let me know how can I see resolution id from script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure if jira-python gives that ability, but you can get resolutions using this simple python requests script that might be handy
import requests
response = requests.get('https://jira.example.com/rest/api/2/resolution', auth=('user','password'))
for index in range(len(response.json())):
print(response.json()[index]["id"],response.json()[index]["name"])
Sample Response:
Ref: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/resolution-getResolutions
Refer to above documentation for REST API stuff, jira python uses the same
Hope this helps., Happy coding!!
Thanks
Chander Inguva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.