How to retrieve create issue metadata with fields in the same order as on the issue create screen?

The create issue metadata returned by GET /rest/api/2/issue/createmeta returns fields from the create issue screen (if requested) as a JSON object (indexed by field key). From what I understand JSON object properties have no particular ordering so I am wondering how can I retrieve the fields in the same order as on the issue create screen?

Is there an easy way without having to go through all the schemes and mappings to figure out which is the screen id and then fetch GET /rest/api/2/screens/{screenId}/availableFields? Am I missing something?

1 Like

Does anyone have a simple solution for this using the REST API?

@BeataSzturemska any plans to ship some API to fix this? We have an integration with a third party system that renders the create issue screen. While we know from the issue create metadata which fields to render we do not know the order of the fields. Including the field order in the metadata, or in a separate API endpoint would be great.

Hi!

I’m afraid the only possible solution is to get the order of fields on create issue view from GET /rest/api/3/screens/{screenId}/tabs/{tabId}/fields, but as you said before it requires fetching a few APIs before.

  • /rest/api/3/issuetypescreenscheme/project?projectId={projectKey}
  • /rest/api/3/issuetypescreenscheme/mapping?issueTypeScreenSchemeId={retrieved_scheme_ID}
  • /rest/api/3/screenscheme
  • /rest/api/3/screens/{screen_ID}/tabs
  • /rest/api/3/screens/{screen_ID}/tabs/{tab_ID}/fields

What’s about storing some useful data (like projectK-issueType-screenID-tabID) in app properties and use them to do a call to /rest/api/3/screens/{screenId}/tabs/{tabId}/fields endpoint.
I suppose these data don’t change so often.

Hi,
@BeataSzturemska Is there a way to get field layout in the new issue view through API?

Hi,
as far as I remember this API doesn’t exist. I have asked a team that owns this feature if they have any workaround.

Thanks @BeataSzturemska,
What did they answer? Is there a workaround?

I’m trying to summon the right person here.

2 Likes