Forums

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

How do I get the 'Resolution' from Jira with python and XML-RPC

Mark Irvine
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!
August 22, 2011

I'm using python to fetch issues from Jira with xml-rpc. It works well except it is missing the 'Resolution' field in the returned dictionary. For example 'Fixed', or 'WontFix' etc.

This is how I get the issue from Jira:

import xmlrpclib
    

    s = xmlrpclib.ServerProxy('http://myjira.com/rpc/xmlrpc')
    auth = s.jira1.login('user', 'pass')
    issue = s.jira1.getIssue(auth, 'PROJ-28')    
    print issue.keys()

And this is the list of fields that I get back:

['status', 'project', 'attachmentNames', 'votes', 'updated', 

     'components', 'reporter', 'customFieldValues', 'created', 

     'fixVersions', 'summary', 'priority', 'assignee', 'key', 

     'affectsVersions', 'type', 'id', 'description']

Th full content is:

{'affectsVersions': [{'archived': 'false',

                          'id': '11314',

                          'name': 'v3.09',

                          'released': 'false',

                          'sequence': '7'}],

     'assignee': 'myuser',

     'attachmentNames': '2011-08-17_attach.tar.gz',

     'components': [],

     'created': '2011-06-14 12:33:54.0',

     'customFieldValues': [{'customfieldId': 'customfield_10040', 'values': ''},

                           {'customfieldId': 'customfield_10010',

                            'values': 'Normal'}],

     'description': "Blah blah...\r\n",

     'fixVersions': [],

     'id': '28322',

     'key': 'PROJ-28',

     'priority': '3',

     'project': 'PROJ',

     'reporter': 'myuser',

     'status': '1',

     'summary': 'blah blah...',

     'type': '1',

     'updated': '2011-08-18 15:41:04.0',

     'votes': '0'}

When I do:

resolutions = s.jira1.getResolutions(auth ) 
pprint.pprint(resolutions)

I get:

[{'description': 'A fix for this issue is checked into the tree and tested.',

      'id': '1',

      'name': 'Fixed'},

     {'description': 'The problem described is an issue which will never be fixed.',

      'id': '2',

      'name': "Won't Fix"},

     {'description': 'The problem is a duplicate of an existing issue.',

      'id': '3',

      'name': 'Duplicate'},

     {'description': 'The problem is not completely described.',

      'id': '4',

      'name': 'Incomplete'},

     {'description': 'All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.',

      'id': '5',

      'name': 'Cannot Reproduce'},

     {'description': 'Code is checked in, and is, er, ready for build.',

      'id': '6',

      'name': 'Ready For Build'},

     {'description': 'Invalid bug', 'id': '7', 'name': 'Invalid'}]

The Jira version is v4.1.1#522 and I using Python 2.7.

Any ideas why I don't get a field called 'resolution'?

Thanks!

1 answer

0 votes
John Chin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2013

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events