Disable "create branch" option depending on issue state

I like the "create branch" option, but it is not appropriate in all issue states. There is (in our workflow) no sense in creating a branch for a closed issue, nor for an issue that is not "in progress". We have set some conditions on the transaction from "open" to "in progress", so we cannot use the create branch trigger to move the issue to "in progress". 

 

Is there a possibility to select in which issue states the "create branch" link is visible?

2 answers

0 vote
Mizan Community Champion Nov 26, 2014

You can write a javascript which will check the status of the issue and remove the development panel from the UI . something like the below script . Not tested its just to guide you . You will need to paste the script in the announcement banner . Try on a test instance first

if (AJS.$.("#status-val").value=="Closed")
{
    AJS.$.("#viewissue-devstatus-panel").remove()
}

Sounds like a promising way forward, but I'd have to learn javascript first to get it to work...

But this will remove the entire dev panel, is there a way to remove only the "create branch" link?

The syntactically correct version is

if (AJS.$("#status-val").text() == "Closed")
	{   AJS.$("#viewissue-devstatus-panel").hide()
	}

But in reality, it doesn't work.

It does hide the panel during the initial time while the bug information is refreshing, but at the end the panel is shown back again. Maybe there is another script running after that that rebuilds it.

So it's still unresolved.

We need this capability, but until now, I don't have any better idea how we can do it.

If someone knows, please advice

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,308 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot