Forums

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

Creating JIRA linked ticket does not use original reporter

Brad Butchers
Contributor
March 28, 2019

Hi All,

Creating a linked issue doesn't use the original reporter field, instead it uses the user creating the linked issue as the reporter. How do I change this?

 

Cheers

Brad

1 answer

1 accepted

0 votes
Answer accepted
Tanya Gordon
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.
March 29, 2019

Hi Brad,

By default, the reporter is filled with the logged in user. You can try writing a script listener that is triggered by the issue linked event and updates the reporter to the one from the linked issue. It will update the history record and send a notification to the new reporter.

For this you will need the script runner app installed and some basic development background in groovy.

Let me know if you need more help with that...

Cheers,

Tanya

deborah a plante
Contributor
May 20, 2019

@Tanya Gordon would you happen to have a script already written for this that you would be willing to share?

Tanya Gordon -HP-
Contributor
May 23, 2019

No, I'm sorry. I don't have something like that written, but I could share several guidelines:

  • Create a scripted listener that is triggered by the Issue Linked event (because the link is created after the issue, so if you listen to IssueCreated you would not be able to see the link yet)

This is the code to understand the issues on both sides of the link:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.link.IssueLinkImpl

def
issueLink = event.getProperties().issueLink as IssueLinkImpl
MutableIssue sourceIssue = ComponentAccessor.getIssueManager().getIssueObject(issueLink.getSourceId())
MutableIssue destIssue = ComponentAccessor.getIssueManager().getIssueObject(issueLink.getDestinationId())

Then you simply read the reporter from the sourceIssue and set it onto the destIssue (or vise versa, depending on the link you use) using the issue.setReporter() function.

 

Hope this helps...

Tanya

Like deborah a plante likes this

Suggest an answer

Log in or Sign up to answer