Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner Listener: How do you grab all fields under a specific tab?

Diana
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.
August 20, 2024

I have a custom listener script that will clear desired fields when an issue is cloned, and it works fine.

But is there a way to only grab fields that are under a specific tab?

For example:

tab.png

If Tab 1 had 20+ more fields, is there a method within listeners to call those fields under Tab 1? The idea is if in the future I need to add more fields under Tab 1, I don't have to update the listener script with new fields every time.

Or is calling tabs only unique for Behaviors?

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Matt Doar _Adaptavist_
Community Champion
August 21, 2024

It depends how you are retrieving the fields from the issue. Those field objects may have a tab attribute you can filter them on, but more likely you would have to use a different approach to find the fields on a given tab. That is more tedious, needing to go from Project to the Issue Type Screen Scheme, then with the Issue Type go to a Screen Scheme, then from there to a Screen, which should have the tab info. 

https://community.atlassian.com/t5/Jira-questions/R-How-to-find-screen-for-issue/qaq-p/2562517/comment-id/723485#M723485 may help a bit

Diana
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.
August 22, 2024

Thanks @Matt Doar _Adaptavist_ 

By any chance do you know what is the order of operation of all the Scriptrunner's capabilities? Assuming an issue uses Issue Create trigger, does it go: Workflows, Behaviors, Listeners?

Matt Doar _Adaptavist_
Community Champion
August 23, 2024

Behaviours are JavaScript, and are rendered when you view a browser page.

Listeners use Jira events inside Jira. These events are triggered when things happen such as Create Issue.

Workflow status changes are another thing that can trigger a Jira event, in the post functions in a transition

0 votes
Dave Rosenlund _Trundl_
Community Champion
August 20, 2024

Hi, @Diana Gorv   You may want to try reaching out to the Sriptrunner team directly…

 

https://the-adaptavist-group-support.atlassian.net/servicedesk/customer/user/login?destination=portals

TAGS
AUG Leaders

Atlassian Community Events