Automation rule to add parent

Jonas van Ravenstein October 12, 2020

I am trying to automatically add a parent to an issue as soon as it is created.
I use the advanced field editing but it seems that my syntax is not correct.
I tried it like this:

{
  "fields": {
    "parent": "CRQ-33"
  }
}

2 answers

1 vote
ziyaad_khoja
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2024

I'm also trying to do this super simple thing, but just can't get it to work. Any update here?

Aaron Neely
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 25, 2024

I was also fighting this; turns out it was a lot easier than I was making it:

chrome_1Utr0SQFGS.png

 

chrome_X8a50kmaN6.png

0 votes
Niranjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2020

Hi @Jonas van Ravenstein ,

Are you trying to link an issue when it is created? If so you may need to check for issue linking functionality

{"update": {
        "issuelinks": [
            {
                "add": {
                    "type": {
                        "name": "Relates"
                    },
                    "outwardIssue": {
                        "key": "{{issue.key}}"
                    }
                }
            }
        ]
    }
}

.

https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/

You can check the issue's meta data with restapi call to  use the correct field.

Jonas van Ravenstein October 14, 2020

Hi @Niranjan,

thanks for your reply.
I don't know if thats the way to add a parent to an issue.
That looks like the way to link a ticket to another ticket by relation type.
Where adding a parent to an issue is more like assigning an epic to the ticket but somehow not quite the same.

In the automation rule one can use the "Edit issue" action which can be used to set ticket fields. In the default field list there is even the field "Epic Link", but selecting that, the following dropdown displaying the Epics do not contain the ticket I want to assign as a parent.

So if that option you mentioned is usable, do you know the type of relation you would have to set there?

Thanks!

Jonas van Ravenstein October 14, 2020

I tried it like this, but that did not work as there is no issue link type like "Parent" or "Child".

{"update": {
        "issuelinks": [
            {
                "add": {
                    "type": {
                        "name": "Parent"
                    },
                    "outwardIssue": {
                        "key": "CRQ-33"
                    }
                }
            }
        ]
    }
}
Niranjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 14, 2020

Hi @Jonas van Ravenstein ,

Check for the available link types in your project. There are different options.

You can create an Epic and link other issue types with "Epic Link" field(This field is to be added to the standard issue type screen). You need to provide the issue key of the Epic in the Epic Link field.

Second linking is creating a sub-task. Here you can associate a sub-task issue type to a standard issue type. 

And if the link types "is parent of", "is child of" is unavailable, then you can ask the JIRA admin to create it.

Apart from these, there is a "parent Link" field in advanced roadmaps(portfolio for jira). I am unsure if you are trying to update that field. There is a bug with restapi update of this field

https://jira.atlassian.com/browse/JRASERVER-65921?

Jonas van Ravenstein October 14, 2020

@Niranjan 

Those link types do not exist in our project and I don't think they have to.

That parent link I am looking for is something different from those ticket links which have that link type.

I have attached a screenshot of a ticket in the project and the option to add a "Parent" manually. Thats what I want to do via automation.

Hope that helps to understand the issue.Screenshot 2020-10-14 at 13.24.54.png

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events