How can I get fields present on screen via REST API?
There is an REST API https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screens/#api-rest-api-2-screens-get for getting screen fields bu it is not returning fileds available on screen.
2 Likes
As far as I remember, you need to call Get all screen tabs and then Get all screen tab fields. In case when you have multiple tabs, you need to iterate over them.
Let us know if it helps you.
1 Like
Please give me a minute as I need to embrace, the pace of you response time.
2 Likes
Iām not sure if we understand in the same way the response of get screen schemes endpoint and the meaning of editable
.
From what I know, these values edit
, view
, and create
respond to a question - which screen should be displayed on the issue edit screen, issue view and issue create screen. If these values are not listed, the default screen is used.
There is a high chance that when a field is not present on the edit screen you canāt modify it via edit issue, but Iām happy to confirm that.
1 Like
Confirmed, you canāt modify the field if itās not on the screen neither via UI nor via REST API.
To summarise,
if screen scheme API returns:
{
"id": 10032,
"name": "Office screen scheme",
"description": "Manage office data",
"screens": {
"default": 10020
}
}
Only fields that are on the screen with id 10020
can be edited.
When the response is:
{
"id": 10010,
"name": "Employee screen scheme",
"description": "Manage employee data",
"screens": {
"default": 10017,
"edit": 10019,
"create": 10019,
"view": 10020
}
}
the default
doesnāt matter, because for every ātypeā view we have different screens declared, so you can edit fields from screen 10019
.
When the response is:
{
"id": 10010,
"name": "Employee screen scheme",
"description": "Manage employee data",
"screens": {
"default": 10017,
"create": 10019,
"view": 10020
}
}
No edit
in the response - then fields that are on the default
screen can be modified.
2 Likes
Great! I am very thankful
How about next-project? How can we get editable/viable fields on nextgen projects?
Team-managed project configuration is out of the scope of my knowledge
Iāve pinged a team, which can have broader knowledge.
I hope they will help.
Beata,
Did the team managed to help?
Here is what I get from the team. I hope it helps.
Thereās no particular API which people can use to fetch fields in a screen for Next-gen. Because Next-gen fields are all āinline-editableā so customers can use the editMetadata REST API to fetch all āeditableā fields in Next-gen as a workaround.
1 Like
@BeataSzturemska API Get edit issue metadata is for a particular issue only. Itās not possible to get all editable fields for whole project (for issue type in a project).
Thereās a call Get create issue metadata which returns fields for the create issue screens for all issue types in the requested project.
Do not know differences between āGet create issue metadataā and āGet edit issue metadataā, i.e. when some fields may be missing in one of them only. Can you clarify that?
I miss some system fields, e.g. Status, in results of both of these calls.
Update 2024: āGet create issue metadataā is deprecated and replaced by 2 new API endpoints, see https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304
@BeataSzturemska any chance to get this work for JSM projects? So far, some endpoints described by @bartlomiej.janczak are restricted to āclassic projectsā only.
Maybe there is already a ticket?
This solution works only for admins. Normal users receive an error: āOnly Jira administrators can access the issue type screen schemes.ā
I tried to achieve this using OAuth 2.0 authentication and granular permissions. I was hopeful that read operations would be allowed, but unfortunately, I still encountered the same error.
Is there another solution?