Hi community,
I'm creating issues in many different automation rules and right now have to let them copy a select few fields every time from their parent.
For example if an issue is created under an epic through an automation I have to copy the associated customer and their adress and some additional fields from the parent. In another if-branch I have to repeat this step for another create action and do this in any other rule that creates an issue. Errors by forgetting some fields or adressing the wrong source are almost inevitable.
My solution to this problem was to define these fields as a project property like this:
So the fields with basic infos are defined on the left and the source from which they should be populated (parent) on the right.
In my rule I wouldn't have to select every field seperately but just input "{{project.properties.parent_basic_infos_property}}" in the additional fields section under the edit issue field action.
But when I do that i get this error message: "Error while parsing additional fields. Not valid JSON."
A log action with the property smart value just gives me exactly what you see in my screenshot. The parent smart values stay as is without retrieving their values.
What's not valid in this JSON object?
I had the same problem in another rule in which I collected some fields in an issue property "summary_entities" on an epic so their child issues could be populated with these fields through this issue property on the epic when one field changes so they would always have these fields synchronized to their parent. When inserting this property in the additional fields of the edit action for the child issues I got the same error.
I solved this problem by wrapping the JSON with extra characters "*+" at the beginning and "+*" at the end:
I then inserted this into the additional fields of the edit action:
{{issue.parent.properties.summary_entities.substringBetween("*+","+*")}}
Somehow the rule no longer had any problem with the vailidity of the JSON.
Does anyone know why?
Sadly this workaround doesn't work in this case because I'm defininig the fields on a project property so it only contains the smart values and not the actual infos I want to copy. It should populate these infos before editing an issue through the additional fields.
In my workaround I already populated the infos during the creation of the issue property and just had to copy the JSON object.
As you can imagine I don't quite understand what the problem might be. Any help would be highly appreciated because it would fix a big problem I continuously have.
Thanks for reading that big block of text!
Hi @Walter Lamm
If I am following your scenario, you are trying to create just-in-time, dynamically executed JSON, not just dynamically defined JSON.
The distinction I am making is:
If that was possible, self-modifying rule behavior would be possible! Which it is not at this time, in my experience. (If they ever make a public REST API for rules, no doubt self-modifying rules will be created.)
Without seeing your complete rule, I hypothesize a few possible workarounds are:
Kind regards,
Bill
@Bill Sheboy Hey, maybe you could chime in? I very much value your expert knowledge all things automation. Thank you!
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.