Hello ,
M using Scriptrunner Behaviors.
I tried adding a error msg using setError() function to issueType system field it is not working.
options i tried :
getFieldById("issuetype").setError("Error Msg")
/////////
import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE
getFieldById(ISSUE_TYPE).setError("Error Msg")
//
i trried getFieldChanged() also still no luck.
for the same readonly and required is working perfecly fine.
Please help
I have tried:
getFieldById("issuetype").setError("Error Message.")
getFieldById(getFieldChanged()).setError("Error Message.")
They both work. It might be a bug, you might want to upgrade your ScriptRunner.
@achal khawale Are you trying to set description for Issue Type field or when user select XXX issue type they get error message ?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.*
def issuetype = getIssueContext().getIssueType().name
if (issuetype.contains("Bug")) {
getFieldById("issuetype")
.setDescription("<font size=\"2f\">This Issue type not in Use</font>")
}
else if (issuetype.contains("Android")) {
getFieldById("issuetype")
.setDescription("<font size=\"2f\"> Testing releated issues <font color=\"red\">Rush requests require Team Lead sign-off</font>")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
setDescription works but no the error. i want to stop user from submitting the form
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @achal khawale if you want to stop creating issue under issue type then hide the issue type from the list or remove from issue type scheme.
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.