Forums

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

How to restrict user to move issue into a special status of another issuetype

Ming P
Contributor
April 21, 2020

Hi,

In my company, I found if one has the authority of moving issue, he  can move issue from "open" of Incident   issuetype to "closed" of Service Request issuetype.

But this  goes against the workflow of Service Request

In workflow of Service Request,it is  not possible to jump directly to "closed" status.

From above, is there any way which can restrict that?

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 22, 2020

Hi Ming,

I understand that you want to be able to restrict which users can move an issue.  As you have noted the ability of a user to move an issue allows them to place that issue into any status of the workflow.

While you could edit the permissions scheme in order to remove the Move permission from those users entirely for that project, there is another more granular configuration you can use to still permit users to move issues in that project when in a certain status.

The use of workflow properties can help here.  What you will need to do though is to edit the workflow in question here.  When you edit the workflow, you can click on the statuses and then click the View/Edit properties.  This allows you to add a property to the workflow status such as

Property Key: jira.permission.move.group


Property Value: jira-administrators

Screen Shot 2020-04-22 at 12.35.46 PM.png

Doing this to a status such as Open, means that only users in the jira-administrators group will have the ability to move issues that use that workflow that are currently in the open status.  Of course you might have to repeat these steps for all the statuses that you do not want users to move out of and/or you might want to select a different group that is still permitted to move such issues. The major thing to remember when adding workflow properties like these is that you still have to publish the workflow draft in order for the changes to take affect in that workflow.

Another thing to watch out for is workflows shared between projects.  Adding a workflow property like this affects all projects that use this particular workflow.

Try this, and let me know if you run into any problems with it.

Andy

Ming P
Contributor
April 22, 2020

Hi Andy,

      At first it is grateful for your reply, and I get what you mean. However, though I can prevent user from moving issue by authorization limit,what I want is for the user not to be able to jump directly to the "cloesd" status by moving issue. In my servicedesk team,"closed" status means resolution of the issue.

     Thus,is there another way to restrict that?

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 23, 2020

Hi Ming,

Sorry if I approached this in a different manner than you were looking for here.  I can see what you are looking to be able to do here.  Unfortunately, Jira server does not have a means to configure this such that administrators could restrict this.  At least not officially.

There have been a few previous feature requests for this such as:

 

That said, I did come across a method that could work for Jira Server (this won't work for Jira Cloud).  You could use the announcement banner in order to inject your own javascript on this page to try to hide that element.  This is not a supported operation, but I did just try it and I was able to hide specific statuses from the move operation window.

To do this,

  1. Go to a move dialog screen
  2. Go to the second step where you can see the statuses to move the issue into
  3. Right click on that field and in your browser choose the "inspect element"  (This opens the developer tools so you can see the HTML code of the site)
  4. It should then show you all the statuses available for that issuetype in that project.  We want to identify the id number of that status "Done" in you site.  In my site it had an id of 10001.  But it's very possible this could be different in your Jira installation.
  5. Once you have that id number you could use a script like this to hide that option
<!-- Script to hide Done option from move window  -->
<script type="text/javascript">
jQuery(document).ready( function($) {
var removeMoveStepDone = setInterval(function() {
AJS.$("#stepped-process > div > section > form > table.jiraform.maxWidth > tbody > tr > td > table.aui > tbody > tr > td > select option[value='10001']").remove();
},1000);
});
</script>

Note, this works on a global scale, meaning it affects all users of the site.  I also know this worked on my Jira 8.7.1, but it is very possible that this might not work on older or newer versions depending on how element names can change between Jira versions.  Let me know your specific version and I can try to see if we can figure out the correct syntax for your version.

Also this might not work for the bulk move operation, it's possible the fields look differently there as well.  But try this and let me know your thoughts.  We might be able to create a second script for hiding the element from that page in the same way.

Andy

Ming P
Contributor
April 23, 2020

Hi Andy,

    Your professional answer helps me a lot . My Jira version is 8.5.0,so is AUI. I found it's a little different from your code.After "inspect element" , I get how to modify the code. Here the code is ,

<script type="text/javascript">
jQuery(document).ready( function($) {
var removeMoveStepDone = setInterval(function() {
AJS.$("#stepped-process > div > section > form >div >table > tbody > tr >td select >option[value='10109']").remove();
},1000);
});
</script>

 This is the first time I know Jira admin user  can use custom JavaScript to change the default function of Jira System .I want to know is there another  entrance for me to user custom script .

 

Ming

Like Andy Heinzer likes this
Ming P
Contributor
April 23, 2020

Hi Andy,

    Thanks again for your professional answer,  could you  focus on another question that has heen bothering me for a  long time? Here the question

Why satisfaction changed does not display in issue change history? 

Nobody answers me and I wonder Atlassian Team can help me or not

Ming

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 24, 2020

Sure thing.  I just posted a response to that one over there.

Regarding other custom scripts, there are actually a few on our Community site and the JiraKB space, but I don't always recommend these to all Jira Admins.  Those kinds of customizations are almost never supported by Atlassian and in turn they tend to break frequently on upgrades to Jira.  It's also possible that some of them have unintended consequences for some users, so you're welcome to search our site for these, but I suggest exercising caution about applying such modifications to your own site.

Regarding your other question:

A heads up, lots of people that look for questions to answer on our Community will specifically look for unanswered questions.  I can see that you posted a reply to your own question over there.  I know it wasn't intended to be an answer to your problem, but this reply technically counts your question as having an answer.  This might explain why no one has responded to it yet.

In the future, I would recommend that you edit your question to add more details to it rather than post a followup question in reply to it.  That way we should still be able to see your question as being unanswered.

Cheers,

Andy

Bal Gill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 6, 2024

Hi,

Apologies that I'm responding to an old thread, but whereabouts can the above custom javascript be added?  When I look at the examples in How to customize Jira with JavaScript and CSS | Jira | Atlassian Documentation, there's no specific example which shows on which screen this should be added.

I have this exact problem when Jira users move an issue between projects, they are moving them to a state I want to hide in the workflow during the move as it goes against the process we have put in-place.

Any help would be much appreciated.

Kind regards,

Bal

Suggest an answer

Log in or Sign up to answer