I'm trying to set up an automatic Assignee change in related tasks.
If Reporter is changed in a task, in some related tasks, I need to change Assignee to Reporter in the main task.
Is there an example of a trigger in Script runner that performs this functionality?
Hi @Max ,
do a custom script listener in Scriptrunner for the event issue updated and then filter whether the reporter has changed.
With HAPI you can easily set the assignee. Here's an example:
def issue = Issues.getByKey('IS1-6')
def orgIssueReporter = issue.getReporter()
log.warn(orgIssueReporter)
def linkedIssues = issue.getOutwardLinks()
linkedIssues.each { it ->
def linkedIssue = it.destinationObject
linkedIssue.update{
setAssignee(orgIssueReporter)
}
}
Thanks for the example.
I can't understand why I get an error in one case and an empty list of related tasks in the other case.
The script is like this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Max ,
In one example, the user does not have permission to be an assignee in this project.
And on the other hand, you would have to add the InwardLinks to the linkedIssues (unfortunately there is no function in HAPI that gets all the links). You can simply add both lists together:
def linkedIssues = issue.getOutwardLinks() + issue.getInwardLinks()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Max this can be done, but can you be a little more clear on the ask. Why would a reporter change?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is how the process is structured. From one project, related tasks are automatically created in other projects. And Reporter is responsible for them. If a task is transferred to another employee, then all related tasks are also transferred to him.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.