Need for a dedicated key for Story points in JIRA Rest api

Yashica Gupta October 24, 2018

Hi,
I am trying to build an Alexa skill integrated with Jira. 

I need to collect the story point of each issue but the response from rest API does not have any dedicated key in JSON to get the “story points”.

It might vary based on jira the server URL.

Example- in our case, “customfield_10004” is defined for story points. 

 

Is there any solution to this? Do you think there could be any other way to get the story points of each issue and subtask? 

 

 

 

 

2 answers

6 votes
Rhys Diab _Agile Docs_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 8, 2019

Hi Yashica.

The way you can consistently get the story points of an issue is to first determine what custom field story points are on for that instance.

To do this, search through the fields using this endpoint: /rest/api/3/field

This will return an array of objects.

Filter the array, looking for the object with the name 'Story points estimate' if it's a next-gen project or 'Story Points' if it's a classic project. 

It will look something like this:

{  
   "id":"customfield_10016",
   "key":"customfield_10016",
   "name":"Story point estimate",
   "custom":true,
   "orderable":true,
   "navigable":true,
   "searchable":true,
   "clauseNames":[  
      "cf[10016]",
      "Story point estimate"
   ],
   "schema":{  
      "type":"number",
      "custom":"com.atlassian.jira.plugin.system.customfieldtypes:float",
      "customId":10016
   }
},

Save the id of this object (in this case customfield_10016). Then look for that custom field every time you request an issue.

This will get you the story point estimate of your issue every time.

Hope that helps!

Andrew Anaton March 10, 2020

Great answer!

Thank you!

D Smith November 21, 2023

Sometimes I wonder if the people designing these Atlassian rest APIs ever actually spoke to developers or considered how they would be consumed... always feels like so much effort for the simplest thing.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2023

@D Smith - Atlassian very much do talk to developers, they even pay for flights and hotels in order to get external people to work with them. 

I'm not in the right role to get a trip to Sydney from them, but I know a lot of Adaptavists who have worked with Atlassian on how they should be extending the REST APIs (and other stuff).  As an example, three of us spent a couple of weeks there working on how to enable Scriptrunner Behaviours on cloud.

So, yes, stop wondering, Atlassian are listening, and working with partners as well.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2018

The only solution is to code defensively - not only do you have to assume the cusomfield_id for Story Points varies by system, it might not be the estimation statistic in that system or project.

The best you can do defensively is to use https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-api-3-issue-issueIdOrKey-editmeta-get to get the fields available for edit in a project, and parse through it looking for something that might be named similarly to "story points".

But, I'd be asking the user to do some setup and tell your application what the field is in their Jira.

Nisarga.lokesh July 25, 2019

How you get the story points from jira?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 27, 2019

Um, look at the issue?

Like aignatyev likes this

Suggest an answer

Log in or Sign up to answer