Forums

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

Issue Scripted Postfunction to set Multi Select list value depend upon reporter

Rajiv Ranjan
Contributor
September 24, 2020

Hi,

I am trying to write a script in the issue Post function to set multi-select list custom field value "Exists"= 'Production' if reporter = Salesforce.

We have a script runner plugin installed so please suggest.

Tried with below code

{code}

if ((issue.reporter?.name == 'Salesforceuser') 
issue.setCustomFieldValue(existin, "Production")

{code}

1 answer

0 votes
Mohamed Benziane
Community Champion
September 24, 2020
Rajiv Ranjan
Contributor
September 24, 2020

Hello @Mohamed Benziane ,

Thank you for looking at it.

Used below post-function script but did not work.

def existsin = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Exists In'}

if (issue.reporter?.name == 'Salesforceuser')
{
issue.setCustomFieldValue(existsin, [Production])
}

Suggest an answer

Log in or Sign up to answer