Search code examples
jirapython-jira

How to look for user who updated JIRA issue using jira-python?


I don't seem to have the permissions to view the transitions on issues.

The commonly used snippet: [(t['id'],t['name']) for t in j.transitions(issue)] returns an empty list on a valid issue. I can see the issue, its transitions from the Web interface.

When the issue is in the "Fixed" state, I would like to find which user changed it from "Assigned" to "Fixed". Here is my workflow:

jira_simple_workflow

How do I achieve this with python-jira?


Solution

  • Insert the following. I use python-3 so you may have to adjust your print statement formats.

    issue = jira.issue('project-682', expand='changelog') changelog = 
    issue.changelog
    
    for history in changelog.histories:
        for item in history.items:
            if item.field == 'status':
                print ('Date:',history.created,' From:',item.fromString, 'To:',item.toString, ' By: ',history.author)