workflow changes do not trigger other workflow
I have a workflow that is triggered when a 'depends on' link is added to an issue. This works fine when I add the link manually. However when I add the 'depends on' link from another workflow, nothing happens (the 'depends on' link is there afterwards, but the workflow is not triggered).
Is this a bug, or is this by design?
(the documentation suggest it should be possible to have a chain of workflows).
Is this a bug, or is this by design?
(the documentation suggest it should be possible to have a chain of workflows).
Please sign in to leave a comment.
rule add ongoing software users when linking using depends on when depends on.added.first != null { var dpdnt = depends on.added.first; var cnt = 0; for each usr in dpdnt.parent for { if (!usr.isResolved()) { var newUsr = loggedInUser.createNewIssue(usr.project.shortName); newUsr.summary = usr.summary; newUsr.description = usr.description; newUsr.subtask of.add(issue); // delegate the 'cloning' of the users to a specific workflow in the user project, // triggered by the adding of the depends on relation newUsr.applyCommand("depends on " + usr.getId()); cnt = cnt + 1; } } if (cnt > 10) { message("Cloned " + cnt + " users from dependent software <a href=\"" + dpdnt.getUrl() + "\">" + dpdnt.getId() + "</a>"); } }Then in the user project for that particular software (multiple projects for each software item), a rule should copy the fields specific for that software. E.g.
rule when depends on another item in same project (e.g. GW), copy field values when depends on.changed && depends on.added.first != null { // this workflow is a way to clone user project items // triggered by the workflow for copying the users to a new software license // specific to the fields present in a specific user project (e.g. GW) var usr = depends on.added.first; message("Trying to clone " + usr.getId() + " to " + issue.getId()); if (usr.project == project) { State = usr.State; Email = usr.Email; End date = usr.End date; License type = usr.License type; License Cost = usr.License Cost; } }This rule works well when triggered by manually linking two user issues with 'depends on', but is not triggered when the first rule is triggered.
Could it have something to do with the fact that the issues are from different projects?
Thanks for looking into it!
Also the depends on.changed condition looks redundant.
I'm not sure I understand what you mean by this, and how that applies to my problem. I'm assuming you saw something in my workflow code that does that? Could you indicate which commands? Thanks!
Does it help?
So do I understand correctly that somehow the depends on.changed is not true when a node is not reported, despite the fact that depends on.added contains items?
This brings me to another question: when a workflow is running and it changes things that trigger other workflows. Are these workflows triggered immediately (and running in parallel) or are they scheduled, or is the triggering only done after the workflow ended?