Disable "create branch" option depending on issue state

Stefan Roels November 26, 2014

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?

5 answers

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 6, 2019

Hello,

Thank you for all your feedback and suggestions about this matter.

As we understand that this would be a useful feature for JIRA, we created the following feature request to get it implemented through JIRA UI:

Disable "create branch" option depending on issue status 

Feel free to vote and watch the suggestion to increase its priority and also receive notifications about any updates.

We hope to have a nice tracking of how many users are requiring this functionality and put some effort to get you with any options to configure it. Thanks!

0 votes
Amin May 8, 2019
<script type="text/javascript">

$( document ).ready(function() {
var devtoolsDoms = AJS.$("a.devstatus-cta-link");
if(devtoolsDoms === null || devtoolsDoms === undefined) return;
var createBranchDom = devtoolsDoms[0];
if(createBranchDom === null || createBranchDom === undefined) return;
var issuestatus = createBranchDom.attributes["data-issue-status"];
var isassignee = createBranchDom.attributes["data-is-assignee"];
if(issuestatus === null || issuestatus === undefined) return;
if(isassignee === null || isassignee === undefined) return;
if( (issuestatus.value !== "Todo" && issuestatus.value !== "In Progress" ) || isassignee.value !== "true") createBranchDom.style.display="none";
else createBranchDom.style.display="block";
});

</script>
0 votes
Amin May 8, 2019

here is sample js code to hide create branch link if user not assigned or status not valid

 

<script type="text/javascript">

$( document ).ready(function() {
var devtoolsDoms = AJS.$("a.devstatus-cta-link");
if(devtoolsDoms === null || devtoolsDoms === undefined) return;
var createBranchDom = devtoolsDoms[0];
if(createBranchDom === null || createBranchDom === undefined) return;
var issuestatus = createBranchDom.attributes["data-issue-status"];
var isassignee = createBranchDom.attributes["data-is-assignee"];
if(issuestatus === null || issuestatus === undefined) return;
if(isassignee === null || isassignee === undefined) return;
if( (issuestatus.value !== "Todo" && issuestatus.value !== "In Progress" ) || isassignee.value !== "true") createBranchDom.style.display="none";
else createBranchDom.style.display="block";
});

</script>

 

0 votes
Hung Nguyen May 22, 2015

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

0 votes
Mizan
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.
November 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()
}
Stefan Roels November 26, 2014

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

Gabriel Ben-harosh Hasson February 1, 2016

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

Suggest an answer

Log in or Sign up to answer