Hello Everyone,
I want to implement below requirement in my JIRA.
We want to change the custom field type select list values based on the user groups in JIRA.
Whenever assignee is changed and he is belongs to different group in JIRA. Custom field value should change.
To achieve this you will need add-on, it's not possible natively in jira. You can look at https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira
This add-on allow you to add some code for your fields, workflow and more.
Hope this helps
Hello Mohamed,
I have script-runner and trying to write script but fail to get value.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
def groupManager = ComponentAccessor.getGroupManager()
def cfSelect = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("CustomeField_name")
def cfConfig = cfSelect.getRelevantConfig(issue)
if(groupManager.isUserInGroup(issue.assignee?.name, 'JIRA-user-group2'))
{
def value = ComponentAccessor.optionsManager.getOptions(cfConfig)?.find {
it.toString() == 'Vlaue'
}
issue.setCustomFieldValue(cfSelect, value)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same scenario , when assignee is changed a custom field value should be changed/reset to null . I tried above solution and did not work using "issue assigned" custom listener . Can you please share if there is a solution on this .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mohamed Benziane : i am using Script runner and have the same scenario, when assignee is changed a custom field value should be changed or reset to null . I tried above solution and did not work using "issue assigned" under custom listener . Can you please share if there is a solution on this ?
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.