How to change "Reporter" to related issue's "Reporter"

Daniel Stava June 10, 2012

How can I change "Reporter" via workflow to related issue's "Reporter" during "Create Issue" transition or "Copy issue function"?

Thank You

3 answers

2 votes
Krzysztof Skoropada [Deviniti]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2012

I've written this as a plugin for free. Binary you can find here:

https://bitbucket.org/intenso/change-reporter/src/2a119369c331/change-reporter-1.0.jar

Fell free to raise an issue for any change requests at https://bitbucket.org/intenso/change-reporter/issues

Yaron Gur-Ari September 3, 2012

Thanks!

Is it possible to use this plugin to set the Reporter to be the current user?

Krzysztof Skoropada [Deviniti]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2012
Yaron Gur-Ari September 3, 2012

Great! thanks!!!

Krzysztof Skoropada [Deviniti]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 5, 2012
Freddie Joyce August 11, 2017

Hi @Krzysztof Skoropada [Deviniti],

 

I'm trying to use the plugin to set the assignee based on a custom user field, but it doesnt work. I have the following set up, can you tell me where I'm going wrong?

 

InUtils 1.PNGInUtils 2.PNG

1 vote
Krzysztof Skoropada [Deviniti]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2012
Check this (paste this to Script Runner )

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 = "KEY-1";
String issueKeyTo = "KEY-2";


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


					
				
			
			
			
				
			
			
			
			
			
			
		
0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2012

You'll need a post-function to do that during a transition. You might want to write one for yourself or maybe use the script-runner plugin (it provides a framework and hooks for you to write stuff like this and saves you having to write things from scratch)

Yaron Gur-Ari September 2, 2012

Appreciate if you can paste the script for changing reporter as I need that too :-)

Thanks!

Suggest an answer

Log in or Sign up to answer