How to find screen for issue

Dariusz PAWLAK March 2, 2023

Hi,

I need to find the id or name of the screen associated with the specified issue. How to do that using the Jira CLI (https://bobswift.atlassian.net/wiki/spaces/JCLI/overview?homepageId=6684681) or REST API?

 

regards,

Darek

3 answers

0 votes
王 博艺
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 18, 2023
def issueKey = "Jira-123"
def issue = ComponentAccessor.issueManager.getIssueObject(issueKey)
def fieldManager = ComponentAccessor.fieldManager
def fieldScreenScheme = ComponentAccessor.issueTypeScreenSchemeManager.getFieldScreenScheme(issue)
def fieldScreen = fieldScreenScheme.getFieldScreen(IssueOperations.VIEW_ISSUE_OPERATION)
0 votes
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 2, 2023

Hi @Dariusz PAWLAK

every issue belongs to an issue type and this has three possible screens - for viewing, editing and creating an issue. These 3 screens are assigned based on the issue type and the project.

In order to retrieve them via the REST API, you can call the following endpoints:

  1. Get issue type screen schemes for the project
    You need to call this endpoint with the projectId parameter. If you don't have the projectId, you might need to call Get project before with the key of the project your issue belongs to.
  2. Get issue type screen scheme items
    You can pass in the issueTypeScreenSchemeId you've determined via step 1 and willl get all the associations of the various issue types to their corresponding screenscheme. You can get the id of the issuetype from get issue.
  3. Get screen schemes
    If you pass the id of the screenscheme as id to this operation, you'll get the ids of the screens.
  4. Get screens
    If you also want to resolve the screen names, you could use this endpoint with all the screen ids.

Hope this helps - it's unfortunately not such a straight-forward process. I've realized this while implementing our app Project Gardener.

Cheers,
Matthias.

Dariusz PAWLAK March 2, 2023

Thx Matthias,

You can see that my Jira is a Server version (see bottom-top corner) and it doesn't provide mentioned  API in ver 3. It is available only for the Jira Cloud version.

Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 2, 2023

Ah, I missed that part - my bad.

I believe for server, the other answer is correct that this isn't possible :/

Dariusz PAWLAK March 2, 2023

Yes, for Jira Cloud is it possible.

0 votes
Naveen Kumar_Appfire
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2023

Hi @Dariusz PAWLAK ,

As it is not possible to get the screen associated with the specified issue using the CLI action. CLI works with the REST API provided by Atlassian.T

There is no REST API for the same 

Dariusz PAWLAK March 2, 2023

What if I know the IDs of: the issue, issue type, screenSchema associated with issue's project?

Is there any indirect way to get screen info?

Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2023

Then you are claiming that CLI adds nothing of value, which is incorrect on the very base level.

The plugin can implement it's own getters and methods to get anything it wants, and expose an interface to do it. That is the fundamental reason why it can do something the out of box REST API cannot - because they create their own endpoints to do various stuff.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.4.0
TAGS
AUG Leaders

Atlassian Community Events