groovy "Script workflow post function" not updating the field values

Hello,

I'm trying to execute a sample groovy script from workflow post function. But the reporter field value is not getting updated 

Script:

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;

String issueKeyFrom = "xxx";
String issueKeyTo = "xxx";

IssueManager issueManager = ComponentAccessor.getIssueManager();
Issue issueFrom = issueManager.getIssueObject(issueKeyFrom);
MutableIssue issueTo = issueManager.getIssueObject(issueKeyTo);
log.warn(issueFrom.getReporterUser())
log.warn(issueFrom.getReporterUser())
issueTo.setReporter(issueFrom.getReporterUser());
log.warn(issueTo.getReporterUser())
issueTo.store();

I deployed the script to the correct location.

When I run this script from script runner console - the reporter field does get updated.

I'm sure that:

  1. The script is correct
  2. It is deployed to the correct location
  3. The script is getting executed when I process the issue to a particular transition

 issueTo.getReporterUser() is logging the correct name. its just when I go to the issue, I cant see the changes. I tried refresh,new window, different browser

Please help!! TIA

1 answer

Does anyone have any clue what might be wrong here? I even checked for long and there are no errors too

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,203 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot