I have created my first forge app for JIRA. Based on the inputs i am able to fire the updates against Story Point. However, currently i have hard coded it.
Since different jira instance would have different custom field name, what is the right way to use custom fields in the code so that it works seamlessly across the board.
This is from a while ago, but I hope it helps someone else. I looked into the “Story Point” field extensively some time ago, and the findings were a bit disappointing:
- “Story Point” is a standard custom field of type “number,” created by Jira Software.
- Unlike other system fields, it is not locked, meaning it can be modified - for example, renamed to something else.
- The field type schema (
com.atlassian.jira.plugin.system.customfieldtypes:float
) is generic and shared with many other numeric fields. Similarly, the searcher key (com.atlassian.jira.plugin.system.customfieldtypes:exactnumber
) is also generic.
- Each board can configure its own field for estimation, meaning “Story Points” is not necessarily the default estimation field.
Conclusion:
There is no guaranteed way to retrieve the field ID for “Story Point” since it can be renamed or replaced. The best approach is to search for it by name using the Jira REST API:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-search-get.
However, this method relies on the assumption that admins haven’t changed its name.