Hi,
i created a custom field (radiobutton), based on the users choise i would like to set the assignee! Can i use Script runner for this setup?
grtz
Rachid
Hi @Rachid Amajoud,
yes, Using scripted post function you can do this. you need to capture the value of the radio button field and set the assignee.
yes. is this going to be part of a workflow transition? You can write a small post function to accomplish this or fire an event on this transition which you can catch in the listener to get the value of the custom field , perform your logic and set the assignee.
Can I work this out with scriptrunner?
It should not be a part of the workflow! Can I work this out with scriptrunner?
Yes, this use case is perfect for scriptrunner. You would need basic groovy to figure this out in less than 10 lines (See scriptrunner documentation for a bunch of awesome examples and code snippets.)
hx for the feedback!
This is my script, but how can I get de value of a radiobutton from a custom field?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
String userName;
switch(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Afdeling").toString()){
case "AB": userName = "Sam";break;
case "CD": userName = "Sam";break;
case "EF": userName = "Peter";break;
case "GH": userName = "Peter";break;
}
issue.setAssignee(ComponentAccessor.getUserManager().getUserByName(userName))
Daryal,
how do I link the radiobutton value with the case, because the case depends on the value of the radiobuton.
It looks like you're new here. Sign in or register to get started.