Forums

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

I would like to hide "Create branch" in jira ticket. I am using Script Runner for this

Nazimuddin Mohammed April 26, 2018

I am trying to hide "Create Branch" from the development panel of a jira issue ticket for the tickets which are already in Closed Status.

I am using "Hide System or plugin UI element", with the following fields

Hide what: com.atlassian.jira.plugins.jira-development-integration-plugin:devstatus.cta.createbranch

Condition:

jiraHelper.project?.key != "IFEL"
issue.getStatus().getStatusCategory() == "Closed"

But this is getting implemented in all the projects with Done status. Some how the conditional operators also dont work when I use "&&" or "&" between the two conditions.

I would like for it to only work for "IFEL" project and for issues with status "Closed". How do I acheive this.

 

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
April 26, 2018

Could you please try below code?

!issue.getProjectObject().getKey().equals("IFEL") && issue.getStatus().getName().equals("Closed")
Tuncay Senturk _Snapbytes_
Community Champion
April 26, 2018

Do not forget the not (!) operator in the beginning of the line. I'm assuming you want to run this for the projects except IFEL

Nazimuddin Mohammed April 27, 2018

Thank you for the answer, I would like for it to only work for the project "IFEL"  and for issues with status "Closed" in the project IFEL.

Tuncay Senturk _Snapbytes_
Community Champion
April 27, 2018

So, exclude (!) and use the script.

Or you can restrict the behaviour for IFEL project and only use below part. That should work.

issue.getStatus().getName().equals("Closed")
Mohammed Nazimuddin
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!
April 30, 2018

if I exclude (!) or include(!), it is making sure that create branch is hidden for all the projects.

In your previous reply you mentioned that we can restrict it to a specific project, How do we do that? can we assign the script fragment in any of the project settings?

Mohammed Nazimuddin
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!
April 30, 2018

To hide create branch on a project when the status of the issue is "Closed" worked with below 

Hide what: com.atlassian.jira.plugins.jira-development-integration-plugin:devstatus.cta.createbranch

Condition:

! (jiraHelper.project?.key in ["IFEL"])
! (issue.getStatus().getName().equals("Closed"))

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events