I am currently using a sub task (defect subtask) to manage defects. Upon creating the create subtask link to create Sub task , a new a defect is created , I would like to assign the defect to the developer using the Assign defect button on the View issue detail screen.
I would like a a warning message to be displayed indicating the defect needs to assigned on the Issue view details page .
How Do I achieve this using script runner . Alternatively I would like to stop the open defect transition to be opened unless the defect is assigned. I would like to display an error message if the developer clicks on Open defect transition .
I want to make sure that the defect is not opened unless the defect is assigned .Do not want it to be Un assigned .
Please suggest script runner solution for these issue .
Reread your question. I will need to think about the first part, but to stop the transition:
I think you will want to use a simple scripted validator on the transition in the workflow.
issue.assignee != null
Then you can put in the error message that you want.
For displaying a message you could create a custom script field and have that displayed on the view issue screen. The message would always be there, but I guess you could add a behaviour to hide it when someone has been assigned. Seems like overkill though.
I adapted something from this link https://scriptrunner.adaptavist.com/6.20.0/jira/recipes/scriptfields/informationMessage.html
package com.onresolve.jira.groovy.test.scriptfields.scripts
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import groovy.xml.MarkupBuilder
import com.atlassian.jira.config.properties.APKeys
StringWriter writer = new StringWriter()
MarkupBuilder builder = new MarkupBuilder(writer)
builder.div(class: "aui-message aui-message-error shadowed") {
p(class: "title") {
strong("Please make sure this issue has been assigned")
}
}
return writer
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.