I want to change the name of the assignee on the selection of the Region dropdown value.
How can I achieve this, Please share the code for the same.
Hi,
You can do this by putting small java script in the single selection field.
Here are some references:
https://answers.atlassian.com/questions/212962/javascript-in-jira-set-values-to-fields-according-value-specified-in-a-listbox
https://confluence.atlassian.com/display/JIRA/Displaying+a+Field+Based+on+Another+Field+Selection
Hope this helps.
Vijay
Hi Vijay,
I want to change the name of Assignee on the selection of custom field value.
for eg:
If the custom field selected value is "1" then Assignee name should be "abc", If the custom field selected value is "2" then Assignee name should be "pqr", if the custom field selected value is "3" then Assignee name should be "xyz" and etc...
Is this possible to change the name of the Assignee on the selection of dropdown value?
Please do the needful.
Regards
If you are doing this at issue creation and before submitting if you want to change value then I guess java script - before performing any event or issue update.
If you want to happen this on issue created, updated event then groovy script do where it will actually change the asignee and email notification will flot
e.g.
import com.opensymphony.workflow.WorkflowContext import com.atlassian.jira.issue.Issue import com.atlassian.jira.ComponentManager import com.atlassian.jira.event.issue.AbstractIssueEventListener import com.atlassian.jira.event.issue.IssueEvent import org.apache.log4j.Logger import static org.apache.log4j.Level.DEBUG import com.atlassian.jira.bc.issue.IssueService.UpdateValidationResult import com.atlassian.jira.bc.issue.IssueService.IssueResult import com.atlassian.jira.bc.issue.IssueService import com.atlassian.jira.bc.issue.IssueService.TransitionValidationResult import com.atlassian.jira.issue.IssueInputParametersImpl import com.atlassian.jira.issue.IssueInputParameters import com.atlassian.jira.util.ErrorCollection import com.atlassian.jira.issue.index.IssueIndexManager class invoketransition extends AbstractIssueEventListener { Logger log = Logger.getLogger(invoketransition.class) @Override void issueUpdated (IssueEvent event) { log.setLevel(org.apache.log4j.Level.DEBUG) def field = event.getChangeLog().getRelated('ChildChangeItem').any{ it.field.toString().equalsIgnoreCase("YourFieldName")} if (field){ def cfg = customFieldManager.getCustomFieldObjects(issue).find {it.name == "YourFieldName"} def cfgvalue =(List<Group>)issue.getCustomFieldValue(cfg) if (cfgvalue == "1") //set issue.assignee = "abc" //else if and so on } } }
Hi Paresh,
Thanks for your help,
The code provided by you is not worked in my case I tried several time but nothing seems to be worked.
Could you please share some code that I can write in the Behaviour, So that while filling the field user can see the update what is going on.
Plesse do the needful
Hi Najmul,
I havent done this myself yet so cant say the articles I posted helps you directly. They are more specific requests and you have to modifiy accoding to your needs.
I can try it for you once I have time. I will get back if I get it to work.
Many thanks for your support, Please let me know when you get any positive output.
Could you help me to resolve the above issue.
Any updates on this issue
It looks like you're new here. Sign in or register to get started.