You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.