Hide "Move Option" in certain issuetypes

Nicole Brückner April 23, 2024

Dear community, 

I found this functionality for hiding in scriptrunner: Hide UI Element Built-In Script (adaptavist.com)

The suggested one-liner is: 

jiraHelper.project?.key in ["SPD"]

This contains the "hide move for project SPD". I just want to exclude issue types. It should not be possible to Move Test & Test Execution issue types. How is the code based on issuetypes? 

Thanks in advance. 

Nicole

3 answers

2 accepted

0 votes
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2024

Hi @Nicole Brückner

The approach you are using will not work. I am saying this because in the coding you have used i.e.

jiraHelper.projectObject?.issueTypes in ["Test Execution""Sub Test Execution"]

Firstly, if you are trying to invoke the issueTypes object from the projectObject, this will not work.

The Issue Types need to be invoked from the issue itself.

Instead, you need modify your condition to:-

issue.issueType.name in ["Test Execution""Sub Test Execution"]

I hope this helps to solve your question. :-)

Thank you and Kind regards,
Ram

0 votes
Answer accepted
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.
April 24, 2024

The "issue" should be in binding variables. So using this works for me:

issue.getIssueType().getName() != "Task"

 

To make it less error-prone in general I think this should be better as we don't want to do any comparisons against null, if there is no issue in binding (outside issue view for example).

!"Task".equals(issue?.getIssueType()?.getName())

 

(Negated due to the inverted "Under what circumstances should this link be displayed." but ofc keep/remove the negation as needed.)

Nicole Brückner April 24, 2024

This worked for me super well! Thank you! ;)

0 votes
Sebastian Krzewiński
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2024

Hi @Nicole Brückner 

 

Did you try to use issueType.name == "Bug" ?

 

Regards,

Seba

Nicole Brückner April 24, 2024

Hi @Sebastian Krzewiński , 

Thanks for the quick response. I tried: 

jiraHelper.projectObject?.issueTypes in ["Test Execution", "Sub Test Execution"]
But this is not restricting it to the listed Issue Types, it is generally disabling the Move (so everywhere). Error showed:
 2024-04-24 09_10_19-UI Fragments und 19 weitere Seiten - Geschäftlich – Microsoft​ Edge.png
Your suggestion is providing this error message:
2024-04-24 09_12_09-UI Fragments und 19 weitere Seiten - Geschäftlich – Microsoft​ Edge.png
Thanks for the help :)

Suggest an answer

Log in or Sign up to answer