Forums

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

How to disable "+ Create Issue" button from project section.

Sambit Choudhury June 30, 2022

I am also facing same problem due to this "+ Create Issue" button in projects sections. This button is creating issue bypassing mandatory fields. We are using Script Runner plugin for the customfield behavior using groovy scripts.

This is a challenge for us, few users created issue using this button by mistake and ended up having no mandatory fields populated.

This project is a "Company Managed project", but if you can let me know how to get this property of project.

We have customized JIRA to accommodate with our requirement of work flow management tool. 

We are using "Atlassian Jira Project Management Software"

 

Please suggest us any work around or any solution to disable this "inline issue creation" block.

 

projectSection_CreateButton_screenshot.PNGprojectSection_CreateButton_screenshot1.PNG

3 answers

0 votes
Florian PEREZ
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.
July 6, 2022

Ok let's get clearer on how to correctly determine how to set mandatory fields: 

- When you want a field to be mandatory on a whole instance -> Behaviour , or less convenient all fields configurations , or JS in banner (yes it's possible but far from good practice)

- When you want a field to be mandatory in a whole project -> Field configuration 

- When you want to make it mandatory on a transition (or in creation) -> validator in workflow

- When you want to make it mandatory depending the value of another field on a single project -> Scriptrunnner's Behaviour (or in the description you can set in the field configuration of the specific project but I REALLY DISCOURAGE THIS)

- When you want to make it mandatory depending the value of another field on a whole instance -> Scriptrunnner's Behaviour only. 

 

Finally on setting default or auto-value on a field: 

- If you want a single default value on a system field -> Scriptrunnner's Behaviour only. 

- If you want a single default value on a custom field -> Context of the field (best practice) or Scriptrunnner's Behaviour for some use cases like having multiple contexts for the same field on the same project for different issue type (a current limitation of the contexts). 

- If you want to automatically change a field value depending on other values ->  Scriptrunnner's Behaviour only.

 

In what case are you currently ?

 

Hope this help !

0 votes
Nic Brough -Adaptavist-
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.
July 1, 2022

There is no reason to do this.

The "create issue" button does not "bypass mandatory fields" unless you've kludged "mandatory" into the system in the wrong way.  If you have used the field configuration or a validator to make your fields mandatory, then this "create issue" route will respect that.

If you insist on doing it this way, you also need to look wider than getting rid of this button - the url it pops will still be usable, the REST API is another route, if you've got JSM, requests can bypass it, and there's a couple of incoming email routes.

I don't think removing the create link here is the right thing to do.  You should be making the field mandatory in the standard way.

Sambit Choudhury July 3, 2022

As we have different transition screens, to make fields mandatory we have used "Script Runner" plugin. This provides wide range of facility like behavior script and others.

System defined configuration will not suffice all the requirements of field behavior management.

Nic Brough -Adaptavist-
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.
July 4, 2022

You should not be doing mandatory fields with Behaviours.  I know it was in there years ago because it was useful, but that was before Adaptavist even got Scriptrunner, and at a time when there was only one way to create or edit issues in the UI.  Now you've got lots of ways to do it, Beavhours can't cover them all, and mandatory fields should be done with field configurations or validators.

Sambit Choudhury July 5, 2022

Is there any other solution for hiding "+ Create Issue" button apart of changing configuration for all fields.

I have tried one approach of adding JavaScript in announcement banner, but this is not consistent. 

Nic Brough -Adaptavist-
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.
July 5, 2022

No, it's not possible to hide it (reliably). 

 Changing the configuration of the fields won't hide it, but it will stop your problem of "lets people bypass mandatory fields", which means there's no reason to try to hide the button.

Florian PEREZ
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.
July 5, 2022

It’s not a good practice and like Nick said you probably have better choice to do rather than hide this. 

if you really want to hide this there’s only two choice :

-js in banner

-you can do this with script fragment https://scriptrunner.adaptavist.com/latest/confluence/CustomisingUI.html . You can hide almost everything with this. The documentation is pretty clear about this.

Again like nick said hiding this is probably not the solution of your use case. You can either make the field appear in validator (if you want this to be mandatory on some transition) or in fields configuration if you want to make this available in every status.

Moreover the behaviour should work on this afiak.

Like Sambit Choudhury likes this
Sambit Choudhury July 5, 2022
  1. If I will use field configuration for making the field mandatory then, behavior will be applied in all screens. That's why we are not using that. If any other solutions available apart of "Script Runner" plugin then please suggest.

  2. Inside banner I have used below code, which is working but in page refresh it's again populating the button.

AJS.$(document).ready(function () {

var hideIssueCreateInProjects = function () {
const collection = document.getElementsByClassName("inline-issue-create-container");
for (let i = 0; i < collection.length; i++) {
collection[i].style.display = "none";
}
};

hideIssueCreateInProjects();

});

 

      3. There is no fragment found for "+ Create Issue" using Fragment locator. Below is the screenshot.

 

createIssue_screenshot.PNG

0 votes
Florian PEREZ
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.
June 30, 2022

Hello, 

I think you shoud be able to this by two way depending on if you want this to be global.

- By adding JS and condition in banner in AJS you should be able to revove the buttonon a specific project

- Globally you can hide his feature using scriptrunner fragment function https://scriptrunner.adaptavist.com/latest/confluence/CustomisingUI.html 

 

Hope this help

Sambit Choudhury June 30, 2022

I have tried javascript approach in announcement banner but it's behaving inconsistently, sometimes when I refresh page it again shows up.

If you can let me know which UI element is this "+ Create Issue" in projects section. So that I can try hiding in Fragments.

Suggest an answer

Log in or Sign up to answer