Hi All,
We have a requirement, Currently client defects can be moved to other issue types like story, task etc. But this needs to be restricted as client defects can only be moved to client defects. Tried with validators but Jira's native Move functionality will bypass all the validators and condition.
Note:- can't disable the "Move" option as it will block the movement from client defect to client defect.
Can anyone provide with this requirement any solution or suggestion will be helpful ..
Hi @Likhita are you using the same workflow for all the issue types?
Thanks for the reply. We have been configured different workflows each issue type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have scriptrunner plugin then it is feasible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To restrict or block the move operation when a client defect is being moved to a different issue type using ScriptRunner, you can create a custom listener that checks the issue type during the move operation. Here's how you can set this up:
Go to ScriptRunner:
Create a New Listener:
Configure the Listener:
Add Conditions:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.issuetype.IssueType
def issueManager = ComponentAccessor.getIssueManager()
def issue = event.issue
// Check if the issue type is "Client Defect"
if (issue.issueType.name == "Client Defect") {
// Get the change history to see if issue type was changed
def changeItems = event.changeLog?.getRelated("ChildChangeItem")
changeItems?.each { changeItem ->
if (changeItem.field == "Issue Type" && changeItem.toString != "Client Defect") {
// Block the move and log a message
throw new RuntimeException("Client defects cannot be moved to a different issue type.")
}
}
}
Save the Listener:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.