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

How to retrieve specific field using Jira Restful API


I am using Jira Restful API to get the issue status for a specific issue. the returned JSON object contains a full description if the status (Name, Icon, Description, ...).

How can I get only the StatusID to minimize the network traffic?

1 answer

1 accepted

You can use fields property in your GET request:

{JIRA INSTANCE ADDRESS}/rest/api/latest/issue/ISSUE-1?fields=status

where ISSUE-1 is key of the issue.  You will not get only status ID but something like:

{"status":{"self":"","description":"Issue is opened","iconUrl":"","name":"Open","id":"1","statusCategory":{"self":"","id":2,"key":"new","colorName":"blue-gray","name":"To Do"}}}}

I guess response is small enough though :)



Thank you for your feedback. actually this is what I am doing now but it is not efficient if you have 


When you have too many results. So I was wondering how to get only the StatusID instead of StatusObject.

Thanks in advance,  

Jimmy, I don't think it is possible. The only possibility is to implement custom REST API with one endpoint or I found script runner allows you to implement simple REST API endpoints:

It will be the same since the bottleneck is getting data from Jira REST API, so if I implemented my own REST API on top of Jira API, it will be the same since I am still requesting all the information from Jira and ignore what I do not need at my side. it will be more efficient to get what I need only from Jira and not everything.

Do you have any other ideas? 

Nic Brough Community Leader Jan 08, 2018

You've misunderstood what the REST endpoint in ScriptRunner does.  It allows you to write an endpoint that does what you need it to.  You could easily code an endpoint that responds only with the Status ID and nothing else when it is poked with an issue ID.

You don't do any work on your side and a handful of lines of code is going to be far more quick than Jira processing all the fields you ask for and sending back status object you don't want.

Thank you so much for your feedback!

I see you your point! So ScriptRunner is built on top of Jira and I will just use it. however in order for ScriptRunner to work, it has to either consume Jira REST API and truncate the not needed data on its side (in this case it will be useless) or it will have direct access to Jira Database to get only the required information (in this case I will have dependency on Jira Database version and ScriptRunner version).

I was hoping to find something already built in Jira REST API to support this as it does not make sense if I am getting 100 issues with two status, I receive the same object for all the 100 issues. I can just get the StatusID and do the mapping at my end.



Nic Brough Community Leader Jan 08, 2018

Not quite, it's neither of those approaches.  ScriptRunner is an add-on that works within the core of Jira.  One of its functions is to provide REST end points.  You write code that uses the internal Java API to get the data you need when something pokes that REST endpoint. 

Your code is dependent on Jira and  ScriptRunner versions, but it's generally quite stable - the last time I had to rewrite my code was because of the significant refactoring Atlassian did between Jira 6 and 7.

It might make sense for your end point to accept a set of issue IDs and respond with something structured like "status 1, these X issues, status 2, these Y issues, etc".

I appreciate your feedback!

So Jira RET API has no built-in support for such filtration and I have to use additional add-on like ScriptRunner for that? the problem is installing add-on is not that easy at my company and a lot of approvals will be required.

Nic Brough Community Leader Jan 08, 2018

No.  The REST API uses "fields=" as you saw earlier to filter down what fields it sends back for each issue.

The reason we've suggested Script Runner is because you want status IDs rather than status objects, and it might be quicker and easier for you to get groups of issues, rather than a flat list.  The built in REST API doesn't do either of those.

Thank you so much for your feedback! Appreciated!!

Thank you Nic, that's what I thought with script runner. Jimmy, you can always implement your own plugin to provide required functionality if it is easier to use in your company but it will require more effort to do it. So I think the script runner is still the easiest solution. 


Thank you Martin!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Software

Early Access: If you use Jenkins and Jira Software Cloud, you need to read this!

The Jira Software Cloud Team has been busy working on a simple, secure, and reliable way to integrate your build and deployment information from Jenkins with Jira Software Cloud. This means you don’t...

2,136 views 3 19
Read article

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