youngmon/atlassian-qna huggingface dataset:
Not running an automation again for - Linking Test issue type to its trigger issue
Asked by Nicola:

Hi there, I have an automation in place as screenshot below.

**When an Issue has its** ***Fix Versions*** **field changed it should create a Test in the same project and link it to the Issue that triggered the rule.**

But - How would I make sure the automation didn't run again if I made the Fix Versions field empty, but then repopulated it again?

So, *not* creating and linking a new test if the issue got moved to a different Fix Version.

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/276723i679425858A75D3AF/image-size/large?v=v2&px=999 "Capture.PNG")


Answers:
author: Jack Brickey
body: You could add a label when the rule runs that can then be tested for as a condition.

for example ...

if labels does not equal "I-ran-before"

comments: author: Nicola
body: I see what you mean. It feels like adding another layer on top of the rule.

I am trying to think of some logic that looks like 'don't run the rule again if there is already a test linked', but I am not sure that is a thing.

I am going to have another think, but maybe you are right - adding a label at the time a test is created and linked and then using that label to not add another test if the issue is moved to another fix version, could be the way to go.


author: Jack Brickey
body: I think you can check for the existence of a linked issue. I recall doing that.


author: Jack Brickey
body: Try using **Related issues condition**

![IMG_2435.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/276784i273A62CE6EC3C130/image-size/large?v=v2&px=999 "IMG_2435.jpeg")


author: Nicola
body: Amazing! I initially added that instruction at the end of the rule and wondered why it didn't work.

Instead I shuffled it around so that it logically made sense as below.

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/277742iAC5FBB96D127797B/image-size/large?v=v2&px=999 "Capture.PNG")

Thanks so much for your help.
Only add two subtasks
Asked by Louise Overmars:

Hi,

We are new in automation and we made a rule to create 2 subtasks when a story gets the status TO DO.

Well that worked.

But, when the story changes from status and is put on TO DO again for the second time, the same tasks are made again.

How do we create a rule that the 2 subtasks are only created once?

![RULE.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/276638i268989323946470B/image-size/large?v=v2&px=999 "RULE.PNG")


Answers:
author: Ravi Sagar _Sparxsys_
body: Hi [@Louise Overmars](/t5/user/viewprofilepage/user-id/5225113)

It is a common question. You can add an If/Else condition in your rule and check if the issue was created earlier. To check that it could be based on something like a specific summary. If in that issue there is already subtasks with that summary then don't create further issues.

You can use the Matching JQL like this.

```
summary ~ "Sub Task title"
```

Condition would be: None match specified JQL.

I hope it helps.

Ravi

comments: author: Louise Overmars
body: I'm gonna try it!

thanks


author: Louise Overmars
body: [@Ravi Sagar _Sparxsys_](/t5/user/viewprofilepage/user-id/853596)

Hi,

I think I'm a total nitwit, but could you please write out the whole rule for me.

I'm doing something wrong and i don't see what :-D

Thanks
Linking Test issue type to its trigger issue
Asked by Nicola:

Hello!

I would like to ask for help on one rule I am trying to set up please.

Rule: **When an Issue has its** ***Fix Versions*** **field changed it should create a Test in the same project and link it to the Issue that triggered the rule.**

However, when I run the automation, the linking part doesn't seem to work.

The original issue remains and the Test issue also gets created but they are just not linked, which is what I am hoping for.

Can anyone please advise where I am going wrong? Thanks in advance.

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/276611i8E2702E4C0E157BE/image-size/large?v=v2&px=999 "Capture.PNG")


Answers:
author: Ash Yadav
body: Hi [@Nicola](/t5/user/viewprofilepage/user-id/5299475) welcome to the Atlassian Community!

You need to go into the second part of your rule and click on "Choose fields to set"

See below:

![Screenshot 2023-08-23 114432.png](https://community.atlassian.com/t5/image/serverpage/image-id/276613iA77B2718AFA8A7FA/image-size/large?v=v2&px=999 "Screenshot 2023-08-23 114432.png")

Kind Regards,

Ash

comments: author: Nicola
body: Hooray thank you that worked. I missed that bit completely! This will really help the team.


author: Ash Yadav
body: No problem, happy to help :)


author: Nicola
body: Sorry just to add onto this - How would I make sure the automation didn't run again if I made the Fix Versions field empty, but then repopulated it again?

So, *not* creating and linking a new test if the issue got moved to a different Fix Version.
How to assign oncall (grabbing the current oncall from pager duty) and assign to incoming Jira task
Asked by Lee Segal:

Hi Community,

I am looking to assign an incoming Jira task to the current oncall. That person would be grabbed from the pagerduty API (<https://api.pagerduty.com/schedules/{id}/users>).

I am currently using Jira Automation but its not working. Steps I am taking:

1. Trigger based on task created

2. Send a web request to pagerduty API

3. create a variable oncall. (Look at screenshot how i do that). I believe this is the step i am doing wrong

![Screenshot 2023-08-22 at 1.38.19 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/276521i9E662A547455A1A8/image-size/large?v=v2&px=999 "Screenshot 2023-08-22 at 1.38.19 PM.png")![Screenshot 2023-08-22 at 1.38.06 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/276522iF3E0ABEFC629F795/image-size/large?v=v2&px=999 "Screenshot 2023-08-22 at 1.38.06 PM.png")


Answers:
author: Bill Sheboy
body: Hi [@Lee Segal](/t5/user/viewprofilepage/user-id/5298931) -- Welcome to the Atlassian Community!

Since the changes for GDPR were implemented, scenarios like this are more challenging to implement. Specifically, you have an email address for your on-call person from PageDuty and it is likely your Jira users have a different user name than their email address.

So a few things to try, in order of difficulty / maintenance:

* JQL: Let's assume the on-call person has had items assigned to them in the past. You could find an example issue and then use that to assign the issue.
  * JQL could be something like assignee IN ( "{{oncall}}" )
  * Use that JQL with Lookup Issues
  * And then grab the first issue to assign the user to the new task with {{lookupIssues.first.assignee.accountId}}
* REST API: Call the REST API to get all possible users, filter by the email address, and use the returned accountId
* Hard-code: use a Lookup Table action to hard-code the possible on-calls using key/value pairs, where key is email address and value is their accountId. Then use the get() function on the table to assign the person. This has a limit of 200 rows for a Lookup Table.

Kind regards,  
Bill

comments: author: Lee Segal
body: Thanks for the reply Bill! Appreciate it!
How to set a date base in another custom field?
Asked by Bridge2Lisbon Lda:

Hi! I'm trying to set up a date in a custom field based on another field.

I found this [Arithmetic and formatting in date variables \| Trello \| Atlassian Support](https://support.atlassian.com/trello/docs/arithmetic-and-formatting-in-date-variables/) which looks like it is what I need but when I create a rule there is no blank space where I can simply put the variable. It only shows this:  

![Trello.jpg](/t5/image/serverpage/image-id/276490i127088957D7D9D56/image-size/large?v=v2&px=999 "Trello.jpg")

How can I do to add the variable based on the other custom field?


Answers:
author: Bill Sheboy
body: Hi [@Bridge2Lisbon Lda](/t5/user/viewprofilepage/user-id/5298769) -- Welcome to the Atlassian Community!

You posted this question in the Automation for Jira area, and I believe you are asking about Trello. Please try posting the question here instead: <https://community.atlassian.com/t5/Trello/ct-p/trello>

Kind regards,  
Bill

comments: author: Bridge2Lisbon Lda
body: Thank you!


Tags: cloud
Automation between jira software and service desk
Asked by Kelly Lillis:

I'd like an automation between Service Desk and Jira Software. We link service desk tickets to jira software tickets. when the status of the software ticket changes we'd like to update the status of the service ticket. Suggestions?


Answers:
author: Fernando Eug?nio da Silva
body: [@Kelly Lillis](/t5/user/viewprofilepage/user-id/4630835)

You can do this using Global Automation.

First of all you need to link your issues between a type of link issues. You can start with this.

In your Service Project create a rule that create a new issue in your software project. It's important here set a linke issue to grantt a relationship between your issues across the projects.

Now create a global rule and limit your project scopes for only these projects.

You can see an example to copy comments between different issues here:

[Copy status updates across Linked Issues](https://www.atlassian.com/software/jira/automation-template-library/rules#/rule/1371700)

You just need to adjust for your case use, but the logic is the same for the others cases.

As this is a global automation, be careful with the global automation limits if the site is Free or Standard.

Check the limits here

![Screenshot_148.png](https://community.atlassian.com/t5/image/serverpage/image-id/276331iBB7EE66244ABDA56/image-size/large?v=v2&px=999 "Screenshot_148.png")

Hope this helps you.

comments: author: Kelly Lillis
body: thank you!!! I will check this out. The limits might be an issue but I will investigate. Appreciate your quick help.


author: Rick Westbrock
body: While it would be more work to implement and maintain you could create this rule in the service project and each project which might have linked issues in that service project. That way the rules are per-project instead of global and as such can have unlimited executions.

comments: author: Kelly Lillis
body: I think that's what I'll end up doing unfortunately.

I am trying to simplify so that

A comment

is addressed to the reporter

of the jira software ticket

when it moves to done

only when the ticket is linked to a Jira Service Desk issue

this is where i struggle a little - how do i get it to know that the linked ticket is from a service desk project?


Tags: atl-gruland
parse json results into a list
Asked by Franco Genga:

Hi, I designed an automation that sends a web request and this is the Json I receive:

{datos=\[{field1=abc, number=1234}, {field1=abcd, number=4567}\], response={description=null, responseCode=200, responseId=null}}

I created a smart value to read the response and get some data: {{webResponse.body.MetodoPagoOut.datos.number}} and I get this string: 1234, 4567

Is there any way to convert the results into a list? I need to extract each pair of values to create an object, using a branch perhaps.

Thanks,

Franco


Answers:
author: Bill Sheboy
body: Hi [@Franco Genga](/t5/user/viewprofilepage/user-id/5295954) -- Welcome to the Atlassian Community!

Please try using the split() function to split the text into a list: <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#split-String-separator->

If that does not help, please post images of your complete rule and the audit log details showing the rule execution. Those will provide context for the community to offer help. Thanks!

Kind regards,  
Bill

comments: author: Franco Genga
body: Hi Bill! Thanks for that response.

I reviewed all the docs and made a lot of tests using smart values for text fields but I still can't resolve it.

What I'm trying to accomplish is to convert this string: "1234, 4567" (now it has only 2 numbers separated by a comma but it could be more in the future) into a collection, so I can use advanced branches, in order to use it as a loop...is it possible? Has anyone could ever resolve this?

Thanks!


author: Bill Sheboy
body: This will work using split(",")

Would you please post images of your rule where this does not work as you expect, including images of the action, condition, and branch details, and of the audit log details showing the rule execution?

Please note: sometimes parsing web request responses results in an *array* rather than a *list*. There are solutions for that, but let's first see what your rule looks like before investigating that possibility.


author: David Foote
body: You can do it via the split(", ") string function others have mentioned.

Something that I struggled with was how to access the data in the newly created list. If you are using the # loop construct, you can access it via {{.}}

So, in your example, if you wanted to loop through the list created by split() it would look like:

```
{{#webResponse.body.MetodoPagoOut.datos.number.split(", ")}}
{{.}}
{{/}}
```

And the output would be

```
1234
4567
```
Linking issues where summary matches the trigger issue description
Asked by Sofia Shaldikova:

Hi everyone,

I have tickets (issue type 1) with a list of emails in the description field. In the same service desk I have tickets (issue type 2) with each of these emails in the summary and there is only one email in the summary of each ticket. I want to set an automation to link the 1st ticket (with the list of emails in the description) with each of the tickets that have the respective emails in the summary.

The trigger would be when the 1st issue type ticket is created. Could you please help with setting up the automation to find the related tickets to link them (the ones which has email in the summary which is one of the emails in the description of the trigger ticket)?

I searched though the previous questions and documentations and tried different options, but still couldn't figure it out.

I tried looking up for issues and linking them, or setting up branch rule with JQL and linking issues. I tried different JQL options, for ex.:

```
"{{issue.description}}" ~ summary
```

```
summary ~ "{{issue.description}}"
```

```
summary ~ "\"{{description}}\""
```

but none of them works.


Answers:
author: Kseniia Trushnikova
body: Hi [@Sofia Shaldikova](/t5/user/viewprofilepage/user-id/5045158),

Here's the rule:

![Rule Overview.png](https://community.atlassian.com/t5/image/serverpage/image-id/275793i1941D3F080827FA5/image-size/large?v=v2&px=999 "Rule Overview.png")

You'll need to create two variables. Let's break the rule down step by step:

1. Add the action **Create variable** to find emails in the issue Description:  
   Variable name: *emails*   
   Smart value: *{{issue.description.match("(\[a-zA-Z0-9_.+-\]+@\[a-zA-Z0-9-\]+\\.\[a-zA-Z0-9-.\]+)")}}*
2. Add a branch with the option **Advanced branching** . Set these values:  
   Smart value: *{{emails.split(",")}}*   
   Variable name: *email*   
3. Add the action **Lookup issues** with JQL *summary \~ "{{email}}"*
4. Add the action **Link issues** and set *{{lookupIssues}}* in the issue dropdown.

As a result, the issues should be linked:

![Rule Success.png](https://community.atlassian.com/t5/image/serverpage/image-id/275796i5D50DD3A07911D8F/image-size/large?v=v2&px=999 "Rule Success.png")

comments: author: Sofia Shaldikova
body: Hi [@Kseniia Trushnikova](/t5/user/viewprofilepage/user-id/4593830),

thank you very much, it works!


author: Kseniia Trushnikova
body: ![giphy](https://community.atlassian.com/t5/image/serverpage/image-id/275885i4204EEACB92CE0CA/image-size/large?v=v2&px=999 "giphy")
Using smart values, how do I add time (hours/minutes) to a custom date time picker field?
Asked by Josh Bray:

When a ticket is created we pass in a Standards of Care value via a hidden field. This triggers an automation rule to modify a date field. For example, add 8 hours, which adjusts the date field forward one day given it is only utilizing business hours. This works via \`{{issue.created.plusBusinessHours(8)}}\`

We are attempting to now utilize a custom date time picker field so we can be more specific with the due date and time. Using the same smart value above sets the date correctly, but does not modify the time, which stays stuck at 1:00PM regardless of when the ticket is created.

I've tried a few modifications to the above smart value, but that only end up breaking the automation completely.

How can we go about modifying the date time picker field with the correct date/time values?

Thank you in advance!


Answers:
author: Sayed Bares [ServiceRocket]
body: [@Josh Bray](/t5/user/viewprofilepage/user-id/5295074) welcome to the community!

Are you sure it is a date and time field? not a date field?

What happens if you use **{{issue.created.plusBusinessDays(1)}}** instead?

Can you share a screenshot from your automation rule and audit log as well?

comments: author: Josh Bray
body: Thank you Sayed - this worked. Not sure why it didn't work with plusBusinessHours given we were trying to modify a time field.
Jira Automation - Link/Create "Related Work" to Version
Asked by Luke Abel:

Hi, I have a working automation that does the following:  

<br />

* On new version created
* Create relevant issues and set the fix version as the trigger version
* Create a new confluence page for a "Release Plan"

I noticed on the release page however, I can add "related work" to this release.

![Screen Shot 2023-08-16 at 3.50.16 pm.png](https://community.atlassian.com/t5/image/serverpage/image-id/275371i3A370341377959C5/image-size/large?v=v2&px=999 "Screen Shot 2023-08-16 at 3.50.16 pm.png")

I want to update my automation to link the Confluence page so that it displays as "related work" on this trigger release. Is this possible to do?

Thanks!


Answers:
author: Agraj Mangal
body: Hi [@Luke Abel](/t5/user/viewprofilepage/user-id/5256899)

I do not think there is a OOTB Automation action today that lets you \`Add Related Work\` to the release.

You can probably log a feature request for the same [here](https://jira.atlassian.com/projects/AUTO/issues/AUTO-215?filter=allopenissues)

Alternatively If you can find a Jira REST API that lets you do this, then we can probably use the \`Send Web Request\` action after you create the confluence page to do this linking but I do not know if such a public API exists today.

Cheers,  
Agraj

comments: author: Luke Abel
body: Thanks for the response [@Agraj Mangal](/t5/user/viewprofilepage/user-id/4772177)!


author: Phill Pafford
body: do you have an example Rest API request?


author: Sairam Sanjay Simha
body: Not sure when this particular one was release, but there is this... <https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-version-id-relatedwork-post>

Unfortunately, this does not seem to acutally LINK the issue


author: Keane Yam
body: Hi Luke, I am in need of help to set up the automation rules that you have. Could you share your steps with me?
Trigger a rule when an Idea is linked
Asked by Dana Weinbaum:

Hi,

I'm trying to create a rule that:

When an Idea (in Product Discovery) is linked to an issue (Epic, Story... for now, I don't have a condition here). The link type is *Implemented by*

Then the labels of that linked issue (that Epic/story) will be copied to the Idea so they will be shown in the idea as well.

In the Labels field of the rule I tried both "copy from trigger issue" and "copy from issue" (I'm a bit confused about which one I should use...), but it won't work.

Any idea what I'm doing wrong?

Thanks

![Screenshot 2023-08-17 at 12.34.31.png](https://community.atlassian.com/t5/image/serverpage/image-id/275696iAB41B48D00BAE61F/image-size/large?v=v2&px=999 "Screenshot 2023-08-17 at 12.34.31.png")


Answers:
author: Wouter van den Berg
body: Almost there. You need to branch before you can copy information.

![Screenshot 2023-08-18 at 17.37.37.png](https://community.atlassian.com/t5/image/serverpage/image-id/275949i7E788E8A3E1EF402/image-size/large?v=v2&px=999 "Screenshot 2023-08-18 at 17.37.37.png")

Select the appropriate related issue parameter:

![Screenshot 2023-08-18 at 17.37.58.png](https://community.atlassian.com/t5/image/serverpage/image-id/275948i5D515284F5C40D1B/image-size/large?v=v2&px=999 "Screenshot 2023-08-18 at 17.37.58.png")  

The rule looks should look like this:

![Screenshot 2023-08-18 at 17.38.11.png](https://community.atlassian.com/t5/image/serverpage/image-id/275947i0DEB11628DE8071D/image-size/large?v=v2&px=999 "Screenshot 2023-08-18 at 17.38.11.png")

<br />

<br />

You could also do a re-fetch data just after the branch but looking at the use-case I don't think that's necessary.  

comments: author: Dana Weinbaum
body: Thanks! but it didn't work :-(

And now there's a very strange thing that has happened - I can't find the link type 'implemented by' anymore in the Jira Product Discovery project (although I saw it last week...).


author: Wouter van den Berg
body: Hi [@Dana Weinbaum](/t5/user/viewprofilepage/user-id/5255605)  

Implemented by is available on non Jira Product Discovery projects. Haven't seen it on the Product Discovery side. Are you sure you saw it there? This Automation rule can't delete link types.   

I have tried a different approach where I used an API call to target the issuelink, create a variable to catch the labels.

<https://your-instance.atlassian.net/rest/api/3/issue/{{issue-key>}}

This worked up till the moment where I wanted to edit the issue with the labels from the Epic. I got the following error:   

You can see the labels (RTLSD and pietjepuk) being grabbed.

![Screenshot 2023-08-21 at 14.33.45.png](https://community.atlassian.com/t5/image/serverpage/image-id/276206iB86F5F4C4CBA5C4D/image-size/large?v=v2&px=999 "Screenshot 2023-08-21 at 14.33.45.png")

Unfortunately I wasn't able to figure out why Labels isn't the same in Product Discovery as it is with other projects and thus couldn't edit the values in the Product Discovery items.


author: Dana Weinbaum
body: Thanks for trying.

And strangely enough the Implemented by returned to the list of link options...