Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to update a field value but field value should not contain reporter in it using a groovy script

Raj Kumar June 10, 2019

Hi,

I Have field called "controller" I am updating value of it using a script in the post function.

Which picks users from a project role, If issue reporter is available as controller reporter has to be removed.

I am using below script but its not working request someone to help fix this.

 

ProjectRole controllerRole = projectRoleManager.getProjectRole("Controller")
ProjectRoleActors controller = projectRoleManager.getProjectRoleActors(controllerRole, issue.projectObject)
def controllerField = customFieldManager.getCustomFieldObjectByName("Controller")
controller.getUsers().toList().remove(issue.reporter)
controllerField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(controllerField), controller.getUsers().toList()?.first()), changeHolder)

0 answers

Suggest an answer

Log in or Sign up to answer