Hi
I'm a complete coding and scriptrunner newbie so please forgive what is probably a basic question.
I am trying to create a Scriptrunner script that will populate an issue custom field with a distinct list of users pulled from two sources: a Jira user group and another multi-user custom field on the issue.
I have at least figured out how to pull in the user(s) in the user group and the user(s) in the issue custom field, but I can't figure out how to create a single consolidated list of unique users from those two sets, and then populate that list into another custom field. I've gotten this far, can anyone help me with the rest please?
Thanks!
import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
def nc = groupManager.getUsersInGroup("new-calc-test")
def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObject("customfield_12705")
def cFieldValue = issue.getCustomFieldValue(cField)
Hi Maahshid
You can't use project permissions on a per-issue basis. If you adjust anything in project permissions based on the status of an issue, you're also changing the permissions on ALL other issues.
I suggest you look into workflow properties instead.
Hi Peter
Thanks for your answer, Actually I want adjust project permission based on the status of project not issue, for exp if the status of the project change to "Closed" all issues related to this project have to be closed and no new issue be created on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no such thing as project status.
But what you are describing can be achieved by changing the permission scheme associated with a project.
PermissionSchemeManager is probably a good place to start
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.
I am not familiar with the app that provides this project-level custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it's not important or key point of my work, because automation rule find this costume field and run script, so now my question :
in script how can I return project key and then read costume field?
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.