The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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])
}