I have several automation rules that work to keep my Epics, Stories, Sub-task, Bugs, and Tasks all in sync where necessary. The idea is that there is only 1 rule per transition (from status A to B) and that rule will handle all the use cases. Currently, the below rule works almost flawlessly, with one exception. In the use case of a Sub-task of a Story that is in an Epic. When the Sub-task triggers this rule, it will correctly transition the parent Story, if necessary, then will transition the Epic related to the Story, if necessary, and it ensures that there is an assignee on a triggering Sub-task and it's parent.
My issue in the above example is when the Story is not in an Epic my rule results in Some Errors (the For JQL statement in the second image). It will correctly continue and finish executing the rest of the rule but when it attempts to check the {{issue.parent.Epic Link}} value, I receive the following error:
"JQL search failed for some issues. This is most likely because the JQL with smart-values was not valid for this query:"(key = "") AND (project in (xxxxx))" - The issue key '' for field 'key' is invalid."
I could just leave it as is and everything will work fine aside from the partial failure to find an Epic when there isn't one, but I would love to be able to distinguish actual failures from these, so to speak, expected failures. Is there a way to validate that the parent of a triggering Sub-task has an Epic Link before attempting to take action on the Epic? Or more generically, is there a way to validate a smart value exists without ending in a partial failure of the rule?
Hi @Ryan Pope
I am unable to answer if there is more generic error trapping for smart values.
Your branch on the {{issue.Parent.Epic Link}} is already inside of an IF/ELSE clause, so could you put a IF condition before the branch, trapping the case of no Epic Link?
Best regards,
Bill
Hi @Bill Sheboy
Thanks for the response!
I have actually tried adding the same smart value to a JQL Condition with no inner action and received the same error. This is the expected JQL result when querying for something like:
key = ""
So I don't think I will be able to query for the Epic Link of a Parent without sometimes getting an error, unless there is another way of conditioning for this that I am overlooking.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, and sorry I wasn't clear in my suggestion...
When I am uncertain if a field will have a value (and the default values won't help), I put a simple condition to check for not-empty before proceeding. I was suggesting adding such a condition before your JQL branch. That should prevent the error from occurring because the branch would not execute.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's kind of the issue. I can't do a simple Related Issues Condition check right before the JQL branch because the condition doesn't have the context of the Sub-tasks Parent, which is what would allow me to check if that Parent has an existing Epic. The Related Issues Condition allows me to check the Parent Epic of the STORY that triggered this rule exists. So if I am not within a For Parent Branch when the rule is triggered by a Sub-Task, then that Related Issues Condition check will never have a chance to succeed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gotcha. At that same point in the flow, could you use a Lookup action to get at the parent with JQL, test the lookup result with a condition for an epic link, and then branch?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ryan Pope ,
I think the way that you'd want to solve this is to keep the For JQL as the last part of your branch and add a guard before hand so it only executes if there is one. Like so:
Hopefully that makes sense!
Cheers,
Simeon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the response!
That would be ideal, I agree. Currently, that For JQL branch is within the if portion of an if/else condition, which means at that level I can only add new Actions or Branches.
I did however take your advice on the Advanced Compare Condition, which I had previously overlooked, and added it to another if/else block at the bottom, outside of my initial if/else block. This seems to be working correctly!
@Bill Sheboy The Lookup Action was still returning the same error, as that is the expected JQL output.
Thank you both for the suggestions! I greatly appreciate it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Ryan Pope . I am glad you got this to work. This one was a good example of several techniques: working around no branch nesting, validating attributes at various levels, etc.
Please consider marking this one as solved so others can search and get the benefit of what you learned. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To test if your value exists, make an automation rule that would put your smart value in the issue description (with some trigger, like a transition) and then trigger it - if the smart value exists, it will return the numerical or string you need to find, and if it doesn't, the description will not update or display a string you tried instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.