Hi All,
Can I change Issue Type on Create Issue Screen based on the value of Single Select Custom Field?
Scenario is if 1 is selected on Single Select Custom Field, Issue type changes to Service Request
if 2 is selected, issue type will change to Bug.
tried using behavior but no luck.
Thank you
Hi @Alvin,
you could write a ScriptListener which listens to the Issue_Updated event. This script could then check for your custom field and adapt the issue type accordingly.
If you search for ways how to change the issue type with scriptrunner, you can also checkout this answer.
Having said that, it is important that your issue types share at least the same workflow, otherwise you'll most likely run into troubles in case you want to convert the issue and it is in a state which does not exist in the other workflow.
What is the reason why you don't change the issuetype directly?
Cheers,
Matthias.
Hi @Matthias Gaiser _K15t_ , Thank you for the very fast response. I want to change it real time , in front of the screen before a user creates the ticket, not after the creation, that's why I try to use Behavior. Is it possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Matthias Gaiser _K15t_ I have different workflow for those issue types, that's why I want to change issue type right on screen based on the value of single select custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you talking about a customer creating an issue via the JSD portal? (You have added the label jira-service-desk-server). Or a user creating an issue via the usual Jira create action?
If Jira: Why don't you let them simply choose the issue type directly?
If JSD: You can configure your request types and map the issue types to them accordingly. I'd recommend guiding the users with the request types to create the correct issue type in the end.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Matthias Gaiser _K15t_ , I am talking about Jira Service Desk but not the customer portal. the agent portal, he usual Jira create action
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Matthias Gaiser _K15t_ via this one on Jira Service Desk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, why don't you let your users choose the issue type instead of the select list?
If you still want to do it, maybe someone else can jump in with more knowledge about Scriptrunner behaviours - if the desired behaviour is possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just want to ask if its possible, manipulating issue type based on the value of select list
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do this on Server with Scriptrunner behaviours, but it will only really work for the plain create screen.
Educating the users, getting them to set the right issue type is the right approach. I would also look at reversing the idea - instead of setting the type based on the list, set the list based on the type (and remembering to educate them about this too - "if you select type A, we will be setting the list to X")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist-, can you check my code?
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def regressionIssueField = getFieldById(getFieldChanged())
def regressedVersionField = getFieldByName("Issue Type")
String regressionIssueValue = regressionIssueField.getValue()
if (regressionIssueValue == "Sample") {
regressedVersionField.setFormValue("Service Request")
} else {
regressedVersionField.setFormValue("Service Request with Approvals")
}
I add a single select field and put it a server-side script. but it does not seem to work.
Can you help? thanks
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.