Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Not able to access a customfield in Jira Rest Api

 need to get the timestamp of the duration an issue was made the transition into "Waiting-for-Input" state. I tried to get this using custom_fields using this URL <{jira-base-url}/rest/api/2/field> I found out there is a custom_field for it which is as follows

{
        "id": "customfield_13225",
        "name": 'Days in "Waiting-for-Input"',
        "custom": True,
        "orderable": True,
        "navigable": True,
        "searchable": True,
        "clauseNames": ["cf[13225]", 'Days in "Waiting-for-Input"'],
        "schema": {
            "type": "string",
            "custom": "com.onresolve.jira.groovy.groovyrunner:scripted-field",
            "customId": 13225,
        },
}

But when I try to access this customfield I get an error like

AttributeError: 'PropertyHolder' object has no attribute 'customfield_13225'

The code which I am trying is

issue = jira.issue('ABC-1')
print(issue.fields.customfield_13225)

Need help to access this customfield.

I am using JIRA Rest API and using python 3.7

2 answers

0 votes
Pramodh M Community Leader Jan 06, 2022

Hi @Rocky 

Please use the below Python Wrapper API to get the details

This one for authentication

https://atlassian-python-api.readthedocs.io/#other-authentication-methods

And this one for getting the Issue details

https://atlassian-python-api.readthedocs.io/jira.html#manage-issues

Let me know if you have any query, the API calls are straight forward

Thanks,
Pramodh

Hi @Pramodh M , thanks for answering,but my question was very specific to the customfield I have mentioned here.I am not able to access this customfield in particular whereas I am able to access the customfield_13800 specified below

{
    "id": "customfield_13800",    "name": "Development",    "custom": True,    "orderable": True,    "navigable": True,    "searchable": True,    "clauseNames": ["cf[13800]", "Development"],    "schema": {
        "type": "any",        "custom": "com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary",        "customId": 13800,    },},


While I notice that the schema[custom] values are different for both the customfields ,I need help in accessing customfield_13225

Pramodh M Community Leader Jan 07, 2022

Hi @Rocky 

Can you please check whether the Custom field with ID 13225 is present in Jira

Yes it is present

Pramodh M Community Leader Jan 08, 2022

See if you are able to implement the solution as in this post and get the details for that Custom field you are looking for

https://community.atlassian.com/t5/Jira-questions/JIRA-cloud-returning-issue-to-python/qaq-p/1904902#M513697

Thanks,
Pramodh

Hi @Rocky ,

You can use this rest/api/3/issue/<issue> (get). When the API return the values you can get the customfield_13225.

Hi @Claudio Gonzalez, could you please elaborate on this point. If you could provide some pythonic examples, it would help me in a great way.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you