Forums

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

Is it possible to block the "Create Branch" in the development panel?

Maria Luce Congedo October 14, 2022

Hi all, I am traying to block the possibility to create a new branch by development panel in Jira when an issue is in "Closed" state.

I am trying by adding new Property in the "Workflow Step Properties", but at the moment I did not find a solution.

I tried "jira.permission.viewversioncontrol.denied", but the Development panel totally disappeared and I want instead to see the commit/branch/pullrequest created in the steps before.

I tried also "jira.issue.editable with false" or "jira.permission.edit.denied", but it seems that they are not related to development panel so I was able to create a new branch.

Do you have any suggestion?

image.png

1 answer

0 votes
Thiago Masutti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2022

Hi @Maria Luce Congedo 
I hope you are well.

This is currently an open feature on Jira Software reported in JSWSERVER-20353  -- Disable "create branch" option depending on issue status.

You might be able to get that working with a JavaScript code hiding the HTML element on selected screens.

Here's an example that will hide the Create Branch element on most screens (it may not work on boards).

<script type="module">
// list of allowed issue status
var allowedIssueStatus = ['Unresolved'];

// When opening an issue from the Issue View
AJS.toInit(function(){
//get status of the issue
var currentIssueResolution = (AJS.$('span#resolution-val')[0]);
if (document.URL.indexOf("/browse") >= 0 && (currentIssueResolution != undefined && AJS.$.inArray(currentIssueResolution.innerText, allowedIssueStatus) < 0)){
AJS.$('.devstatus-cta-link').hide();
}
});

// When opening an issue from the issue queue and search
$( document ).ajaxComplete(function( event,request, settings ) {
if (
(document.URL.indexOf("/secure/RapidBoard.jspa") >= 0 && settings.url.indexOf('/issue/details.json') >= 0) ||
(document.URL.indexOf("/browse") >= 0 && settings.url.indexOf('AjaxIssueAction!default.jspa') >= 0) ||
(document.URL.indexOf("/projects") >= 0 && document.URL.indexOf("/issues") >= 0 && settings.url.indexOf('AjaxIssueAction!default.jspa') >= 0)
){
//get status of the issue
var currentIssueResolution = (AJS.$('span#resolution-val')[0]);
// hide
if(currentIssueResolution != undefined && AJS.$.inArray(currentIssueResolution.innerText, allowedIssueStatus) < 0){
AJS.$('.devstatus-cta-link').hide();
}
}
});
</script>

Kind regards,
Thiago Masutti

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events