Hi,
I am trying to create an automation so that a new ticket automatically links to a "parent ticket" based on a specific field in a form (the employee's name). For context, when an employee is first onboarded, their manager will complete a form requesting certain hardware and software for them. I would like any new software/hardware requests that are created after that initial request to be automatically linked to this original ticket.
How might I go about this? Is there a way to create an automation based on user information? In the onboarding form, there is a field that will list the employee name. There will also be a field for this in the other software/hardware forms.
Thanks!
Hello @Grace O_Leary
Welcome to the Atlassian community.
The field on the form corresponds to a field in the underlying request type. What type of field is the Employee Name field?
You can create an automation thus:
1 Trigger: Issue Created
2 Action: Lookup Issues
JQL: issue!={{issue.key}} and "Employee name"={{issue.Employee Name}} and issue not in linkedIssues("{{issue.key}}) order by created asc
3 Condition: {{smart value}} condition
First value: {{lookupIssues.size|0}}
Condition: is greater than
Second value: 0
4 Action: Link Issues
Link type: <your choice>
Link to: {{lookupIssues.first.key}}
Action 2 looks for any issue, other than the trigger issue, where the Employee Name field values match and the trigger issue is not already linked to it. This could return 0..n issues. So I added an ORDER BY clause to order them oldest to newest. My assumption the one you want to link to is the oldest issue.
Condition 3 confirms that you got at least one issue returned by the lookup.
Action 4 creates a link between your trigger issue and the oldest issue returned by the lookup, assuming at least one issue was returned by the lookup.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.