Hello!
I have the following automation in nextgen project:
* When issue is linked, assign the new linked issue to the source issue parent (epic).
However, I keep getting "invalid JSON" error.
Any idea?
@Sahar ben
let's see if we can find the answer here from the community.
Hi @Matan Grady
I believe you need to branch on the destination issue for that smart value to work. Please look at this article for details:
https://blog.codebarrel.io/how-to-use-the-linked-issue-trigger-in-automation-for-jira-1616b68c2d6e
Best regards,
Bill
Hello @Bill Sheboy , and thanks!
Actually I was managed to get the issue parent.My problem is with updating the issue parent.
I can't understand if jira next-gen projects supports updating an issue parent.
When you edit/update an issue, that issue needs to be the focus in the rule. For example, it needs to be the trigger issue or an issue within a branch's selection.
Although you may be able to see the key of a parent with the syntax you are showing, the rule isn't updating the parent: it is not "in scope".
Just to be clear, are you trying to update:
If you want #1, as simple branch on parent should work. If you want #2, you would need to use a branch on JQL for the key of that linked issue's parent. They you may perform the edit within the branch.
Hi @Matan Grady ,
You should be able to select 'Epic Link' from the fields dropdown in Edit issue action.
Automation is able to figure out that the issue being acted on belongs to a next gen project and it will set the correct field (parent).
Eric
Hi @Bill Sheboy ,
This is not my problme. My problem is how to update the issue (I am already on the right branch for it), but assign a parent to it.
For example, update issue X-123 to be a child of issue X-5.
Hello @Eric
I need to update the field from advanced field editing.
This is how my JSON looks like.
Still I get an error of invalid JSON.
Any ideas?
looking at your requirement I was able to reproduce an automation rule which worked fine in my demo next-gen project.
Setup: I have an Epic (ACC-4) as well as a story (ACC-2) linked to the Epic.Now I have an additional story (ACC-3) that I link to previously created Story ACC-2.=> The Epic link (to ACC-4) is added to ACC-3
In case I got you right here is the automation rule so you can double check:
The interesting part might be "Edit issues fields" where the following JSON made it work:
{"fields": {"parent": {"key":"{{issue.issuelinks.inwardIssue.epic.key}}"}}}
"Add comment to issue" however was just for testing purposes - I would not put that into production.
In case you'd like to check and let us know if this is what you were looking for I'd appreciate that.
Cheers,Daniel
Hello @Daniel Ebers .
Still can't get it to work!
Note that I can't do the change on the branch as the item I am editing is on the main branch.
The setup I did it attached, so is the error I get ("Could not find issue by id or key. (parent)".
I am unsure if it works the way you setup the rule - probably this won't be the case.Unfortunately, I cannot tell you anything beyond this but to confirm the rule I suggested worked in my setup.Probably you will find other users contributing to fixing the rule you presented.
I'm also facing a similar issue. This issue is a bug on how parsing Jira Smart Values when using inside JSON.
Basically, the issue is it will error if we use Jira Smart value without double quotes
However, if we put the Smart Value inside double quotes, then it will set it as a string, which is incorrect because the field was intended to be set as a JSON object.
For example, suppose we have customfield_10132, which is a label.
This one will work (we hardcoded the value):
{ "fields": { "customfield_10132" : ["valueA", "valueB"] }}
This one won't work (we got an "invalid JSON error"):
{ "fields": { "customfield_10132" : {{issue.parent.labels.asJsonStringArray}} }}
This one also won't work (we got a "Specify the value for in an array of strings (customfield_10132)"):
{ "fields": { "customfield_10132" : "{{issue.parent.labels.asJsonStringArray}}" }}
because I think, the above configuration will be translated into the following:
{ "fields": { "customfield_10132" : "[\"valueA\", \"valueB\"]" }}
The example on this documentation is misleading:
https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/
Because we're unable to use Jira Smart Value without double quotes!
Please help to fix this.
It looks like you're new here. Sign in or register to get started.