Forums

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

Jira Python API Changelog Question

Ingo Weiss April 17, 2025

Hi all, I am writing a Python script that uses the Jira API to retrieve an issue's changelog history items. Each item has the following schema:

{'field': 'Fix Version',
'fieldtype': 'jira',
'from': None,
'fromString': None,
'to': '27765',
'toString': 'Version 1'}

I want to use the 'field' value to look up other information about the field being changed. When I use jira.fields() to retrieve information about all Jira fields, each field has the following schema:

{'id': 'fixVersions',
'name': 'Fix Version/s',
'custom': False,
'orderable': True,
'navigable': True,
'searchable': True,
'clauseNames': ['fixVersion'],
'schema': {'type': 'array', 'items': 'version', 'system': 'fixVersions'}}

The problem is that neither of the available identifiers in the above schema exactly matches the value in the changelog history item ('Fix Version' in this example). How do I perform the lookup here?

Cheers,

1 answer

0 votes
David Nickell
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 path to becoming Community Leaders.
April 18, 2025

Intresting... I would have said you always match on the ID. 

Maybe this Has nothing to do with it ... but if you treat the "/s" like it has been escaped, that name "Fix Version" matches  what I see as the "Field"  in the changelog

 {
    "id": "fixVersions",
    "name": "Fix Version/s",
    "custom": false,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": [
      "fixVersion"
    ],
    "schema": {
      "type": "array",
      "items": "version",
      "system": "fixVersions"
    }

 ChangeLog Fix V.png

So I applied the same thinking to "Component/s" and "Component" and the theory holds up...

Lets go with that :-) ... "/s" is escapeed Or ignored when you match field names

  {
    "id": "components",
    "name": "Component/s",
    "custom": false,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": [
      "component"
    ],
    "schema": {
      "type": "array",
      "items": "component",
      "system": "components"
    }

 

Component.png

 

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events