You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Join now to unlock these features and more
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?
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:
"name":"Story point estimate",
"Story point estimate"
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!
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.
@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.
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.