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 votes
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 Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

24,860 views 2 7
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