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?
Hi @Matan Grady
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)".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Matan Grady hi, I'm also trying to set a newly created initiative as parent to the triggered epic, but it's not working (JSON error).
How did you manage to set this link through JSON?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Indira -- Welcome to the Atlassian Community!
First, please consider creating a new question and linking to older threads when needed. That will get the most visibility for people to help, as only the people currently watching this thread will see your post.
Next, for your question on automation rules, context is key. Please post images of both your complete rule and the audit log details showing the rule execution. That will help the community see what you are describing to offer suggestions. Thanks!
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi @Bill Sheboy thank you for your reply. I found the solution in the meantime (the automation created a new initiative from a triggered epic - the task was to make this created initiative the epic's parent). The parent linking is made in JSON in the following way:
{
"fields": {
"Parent link": "{{createdissue.key}}"
}
}
(sorry if this question is not relevant to this topic, in that case please delete my comments, since I am not able to do this). Thank you.
P.S. could you please delete my tag (surname) from your post above? Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I updated it, and as an FYI...that information was coming from the name setup in your profile. Please change that to match what you wish to display. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
let's see if we can find the answer here from the community.
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.