youngmon/atlassian-qna huggingface dataset:
How to recalculate if a due date in a parent task is changed
Asked by Stephan Kress:

Dear Jira community!

In my Jira project, there is a sub-task, which is calculating the due-date due to the due-date in the parent task:

{{issue.dueDate.minusbusinessdays(40)}}

If the date is changing in the parent task, how to get an automated recalculation in the sub-task?

Thanks for your help in advance!


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

It seems you already have an existing automation rule. Please post images of that rule and the audit log details showing its execution. That may provide context for the community to offer suggestions. Thanks!

Until we see those...

I hypothesize that your current rule is triggered on Create Issue for the sub-tasks. That is only one of the possible scenarios needed for your use case. The others include...

1. When the parent's due date changes, branch over the open (i.e., not completed) sub-tasks to edit their due date. (This is the one you asked about.)
2. When a user directly edits the due date for a sub-task, what do you want to do?
3. And the edge case: when a sub-task's parent changes, update the due date to match the new parent

Please try implementing #1 as described with a branch and if you need help, please post back here so the community can offer ideas.

Kind regards,  
Bill


Tags: due-date
Link issue to existing EPIC - JIRA Automation
Asked by jvantrease:

Hello,

I am attempting to create a rule that edits the epic link and assigns a specific epic to that issue. I am using the following JSON

{

"fields": {

"Epic Link": "ISSUE_ID_OF_EPIC"

}

}

I receive an error stating

##### [Edit issue](https://dtsdhs.atlassian.net/jira/software/projects/DHHSORSIS/settings/automation#/rule/10446398/226161562) {#toc-hId--1587848900}

Error editing issues  
SomeIssue-160 (Issue 'ISSUE_ID_OF_EPIC' must be of type 'Epic'.)  
The issue shows up as an epic. I think I am missing something. Any help would be appreciated. Thank you.

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


Answers:
author: Stefan Salzl
body: Hi [@jvantrease](/t5/user/viewprofilepage/user-id/5154034) and welcome to the community,

Some questions:

1. In your screenshot it seems your action is in another "line" (like it would be if there is a branch in between). Is that the whole automation rule? If not please provide complete material for the community to be able to do a propper analyze.
2. you mentioned "ISSUE_ID_OF_EPIC" --\> did you write the issueID or the issueKey into your JSON? I tested with adding the issue key to a JSON and it worked like a charm.  
   eg.:  
   ![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/244384iA70400187DA5237B/image-size/large?v=v2&px=999 "image.png")  
3. If you added the key in your JSON please provide a clear screenshot of your JSON as well as from the issue you are trying to link.

Best  
Stefan

comments: author: jvantrease
body: Hello Stefan,

Thanks so much for your help. I eventually figured out the issue. The issue I was trying to link was not an Epic issue. It was in fact a User journey. Sorry to bother you.


author: Stefan Salzl
body: That would have been my main guess ;)

Good to know you got that working and thanks for your feedback


author: David Pezet
body: You might try passing the entire issue instead of just the key. If you only have the key to work with, you could use a [lookupIssues](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--lookupIssues--) action to get the issue based on the key. This returns a list, so you will probably need to reference it as {{lookupIssues.first}} to return the whole issue.

comments: author: David Pezet
body: Oh sorry! I just saw that you have both the Epic Link field and Epic Link in the Additional fields section. This could also cause problems. You'll want to uncheck that in the dropdown when using the Additional fields.
Extracting a number from the issue summary
Asked by Marcus Jones:

I have a use case where I am sending in emails to Jira service management to create tickets. Those emails will have multiple attachments and I want to add a system where I can count the # of attachments as the # of tasks. Kind of like a weighting system i.e. One task may have 3 attachments so it's weighted as 3 vs a task that only has 1 attachment weighted as 1. I am appending the # of attachments in the email subject line in a standard way which flows into the summary of the Jira ticket. My question is how do I extract that number from the summary so I can use automation to apply it to a custom field I created?


Answers:
author: Darryl Lee
body: Hi [@Marcus Jones](/t5/user/viewprofilepage/user-id/5132701) - another option is to simply count the number of attachments, using the smart value: **{{attachment.size}}**

The trick is that the "Issue Created" trigger will probably fire before all of the attachments are attached.

Yup - the first time I did this I got 0.

So I pulled the old "Re-fetch issue data" trick and that seemed to do it:

![Screen Shot 2023-03-07 at 4.11.54 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/244391i53B37D78EC9BA8D0/image-size/large?v=v2&px=999 "Screen Shot 2023-03-07 at 4.11.54 PM.png")

It'd probably be good to have some kind of keyword or something in the Subject/Summary to make sure we know it's an issue coming in via email instead of directly in Jira.

Oh, and you'll want to test with big attachments, etc. to make sure it's always getting the count right, regardless of file size, etc.

comments: author: Marcus Jones
body: I really like this way of doing it as well actually, it makes it so I don't have to append the # of attachments in the summary field keeping it cleaner. Issues come into this project only via email so I shouldn't have an issue with issues being created by agents or in the portal.

Thanks for the help!


author: Mohamed Benziane
body: Hi,

Welcome to the community

You can try to use the substring function with Automation

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/>

comments: author: Marcus Jones
body: This was helpful thank you! I ended up surrounding the # with \* and used this expression to extract:

{{issue.summary.substringBetween("\*","\*")}}


Tags: jira-cloud
Web scraping on Jira Tickets
Asked by siwar zouita:

I have a project in which I need to extract the details of Jira tickets to implement in a database and start comparing them,

I need to use the web scraping selenium python to extract the data, is it feasible?  
If yes can you please provide a method so I can continue the work,

Kindest Regards!


Answers:
author: Prince Nyeche
body: What happened to simply export the tickets to a flattened file structure which you can use? To be exact use the advanced issue search of Jira to export the issues.


author: Mohamed Benziane
body: Hi,

i think this will be possible, the most easy thing will be to know each issue key. But my question is why you don't use the API ? Is more flexible and simple that selenium for me.
Read key word from Summary change Organisation
Asked by Jake Ralph:

Wondering if someone can help me.

I'm looking to try and have an automation that reads the summary of an issue, takes a key word from the summary, and then changes the organisation, to match that key word taken.

Thanks


Answers:
author: Bill Sheboy
body: Hi [@Jake Ralph](/t5/user/viewprofilepage/user-id/4509281)

Extracting the keyword from the Summary is likely possible using the automation text functions: <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/>

However, updating the Organization may not be possible, as described by this suggestion to add that capability: <https://jira.atlassian.com/browse/AUTO-637>

Those suggestions do not always get updated as automation improves, and so I suggest using this how-to article to learn if automation currently supports that field as a smart value. Basically you identify an issue with your field, call the REST API with a browser, and then search for the field. If you find it, you will learn the syntax to update it using [advanced edit with JSON](https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/). If not, the field is not supported.

<https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>

Kind regards,  
Bill
How to automate the upload of the time record in Jira?
Asked by Federico:

Good afternoon,  
I am trying to automate the registration of time in a project, in it we use the Actual Start and Actual End fields which register Days and Hours, the problem arises with the formula that I am using which in theory should work but it does not, it The first thing I do is the following: create a flow where it is executed when the Actual End field is updated, after that it must register the time.  

So in the "When" flow I use the change of values ??of a field and in the "Then" flow I use the record time component in the same setting as the Actual Start start date and in the time spent field I put the following expression

```
{{issue.ActualEnd.diff(issue.ActualStart).hours.abs}}h
```

and i get the following error

```
Error attempting to register work on an issueWorklog must not be null., Invalid time duration entered. (timeLogged)
```

Could you help me by indicating if it is possible to automate the registration of hours or what should I change in my expression to make it work?


Answers:
author: Federico
body: Well, after running many tests, I was able to find the error, which was that I was incorrectly entering the field names. If it's useful to anyone, I created an automation where hours are logged based on 2 standard Jira fields.

```
{{issue.Actual End.diff(issue.Actual Start).minutes.abs}}m
```

I also share the images of the workflow performed so that you can recreate it. The only thing is that, since my Jira is in Spanish, you should translate the images to understand them.  
![Automatizacion.png](https://community.atlassian.com/t5/image/serverpage/image-id/243865i1AD25253C02BC012/image-size/large?v=v2&px=999 "Automatizacion.png")


Tags: cloud
Action to comment objects
Asked by Sebastian Hoehne (alt):

Hello,

I would like to create a comment for an object/asset in an automation rule. Unfortunately I can't find a action to comment on objects (only edit/create). Is this possible?

If yes: can i mention a linked Jira issue in this comment? I want the URL of the linked issue to appear in the objects' comment. (e.g.: "Hello, the linked issue for this asset is \[URL\]")

<br />

Thanks a lot in advance!


Answers:
author: Bill Sheboy
body: Hi [@Sebastian Hoehne (alt)](/t5/user/viewprofilepage/user-id/704378)

First thing: I am not using Jira Service Management, and so my suggestion is based on the documentation and what I know about automation.

I do not see a built-in ability to add a comment to an object for rule actions, or any suggestions to add that ability in the public backlog.

You could try using a webrequest action to call the REST API function to add the comment.

Here is a how-to article for calling the REST API from a rule: <https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828>

And here is a reference to the REST API for handling comments in JSM: <https://insight-javadoc.riada.io/insight-javadoc-8.6/insight-rest/#comment>

Kind regards,  
Bill

comments: author: Brock Jolet
body: [@Sebastian Hoehne (alt)](/t5/user/viewprofilepage/user-id/704378) I wasn't able to find the correct call for retrieving or adding comments on Assets Objects in the official documentation here: <https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-id-get>

<br />

But I was able to find this doc that references comments, though the format of the call seemed incorrect: <https://docs.atlassian.com/assets/REST/10.4.4/#comment-getComments>

Using those two as references, I could piece together two working calls for retrieving and adding comments on Assets Objects. I have no idea if these are deprecated since I can't find them in the official docs.

* Retrieve comments:
  * <https://api.atlassian.com/jsm/assets/workspace/{{jiraWorkspaceID}}/v1/comment/object/{{objectId}}>
* Add new comment:  
  * <https://api.atlassian.com/jsm/assets/workspace/{{jiraWorkspaceID}}/v1/comment/create>
  * Body:
      * {  
      "comment": "This is a test comment from an API call.",  
      "objectId": {{objectId}},  
      "role": 0  
      }

You should be able to use those in a web request node in Automation as [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) referenced. It is working for me.


Tags: cloud
Project automation limits We are not using cloud jira
Asked by Suneeta Gupta:

I want to use If/else block with components but i got the error message for limitations is there any options we to resolve?

Thanks

Suneeta


Answers:
author: John Funk
body: Hi Suneeta,

Can you share the rule that you have and the exact error you get?

comments: author: Suneeta Gupta
body: Error massages shows you have rechecked number of components


author: Bill Sheboy
body: Hi [@Suneeta Gupta](/t5/user/viewprofilepage/user-id/5058067)

Adding to John's suggestion...

Please post images of your complete automation rule and of the audit log details showing the rule execution. Those images will help the community to offer suggestions. Thanks!

Kind regards,  
Bill
How to disable Automation Notifications in Jira
Asked by Rasajna Meka:

If my automation is updating any field value in the issue , it consider this as issue updated and sends notification to the assignee and reporter . How to disable these notification as its spamming the reporter/assignee mail box


Answers:
author: Alex Koxaras _Relational_
body: Duplicate question here: <https://community.atlassian.com/t5/Automation-questions/How-to-disable-Automation-Notifications/qaq-p/2285344>
How to disable Automation Notifications
Asked by Rasajna Meka:

If my automation is updating any field value in the issue , it consider this as issue updated and sends notification to the assignee and reporter . How to disable these notification as its spamming the reporter/assignee mail box


Answers:
author: Ignacio Pulgar
body: ![this-rule-should-send-emails-checkbox.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/243203iAA4F4B48A9723A9C/image-size/large?v=v2&px=999 "this-rule-should-send-emails-checkbox.PNG")

comments: author: Alex Koxaras _Relational_
body: I had totally forgotten about this! [@Ignacio Pulgar](/t5/user/viewprofilepage/user-id/781574) is right. Try this instead!

Good job Ignacio!


author: Mike D_
body: I don't see that option, what am I missing? ?

![no disable notification.png](https://community.atlassian.com/t5/image/serverpage/image-id/302341iC1C761480130911A/image-size/large?v=v2&px=999 "no disable notification.png")


author: Evn Tomeny _Appfire_
body: Hi Rasajna,

If I'm understanding correctly, you're going to need to update the notification scheme. You have "Reporter" and "Assignee" receiving notifications for "Issue Updated". You can probably safely remove everyone from "Issue Updated", and make sure they're in "Issue Transitioned", "Issue Commented", or whatever other actions you want to notify them about.

Notifying on every single issue update can be spammy even before you start putting Automations in place. I generally don't send this notification, but ultimately it's up to you.


author: Alex Koxaras _Relational_
body: Hi [@Rasajna Meka](/t5/user/viewprofilepage/user-id/5058734)

If your automation is updating any issue, then the "Issue Update" event is being fired, which it sends out notifications to all the people you have under "Issue Updated" notification.

Imo you can't block this if you are using Jira Automation, since there is no option not to send out notifications. If you were using an app like JMWE, then you would have this functionality.

comments: author: Hugh Kelley
body: Is there any way to prevent the non-email notifications from cluttering up the UI?

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


author: Mike D_
body: yes, what Hugh said! ?


author: John Funk
body: Hi Rasajna,

have them take themselves off from being watchers of the issue. Depending on your notification scheme, that should take care of it. But if they are watcher they will receive everything.


Tags: jira-cloud
Automating send email on release
Asked by Maroun Maroun:

Hi,

I'm new to automations in Jira, and I can't find a good documentation to begin with.

I have the following email HTML:

```
A new version was successfully released. Please find the RN below:

{{#lookupIssues}}
<li>{{issue.key}}</a>: {{issue.summary}}:{{issuetype.name}}</li>
{{/}}
```

My automation:

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


Answers:
author: Maroun Maroun
body: Fixed by having

```
fixVersion = '{{version.name}}'
```

instead of:

```
fixVersion = {{version.name}}
```


author: Darryl Lee
body: You might also want to change your email body so that the HTML is actually correct:

```
{{#lookupIssues}}
<li><a href="{{url}}">{{key}}</a>: {{summary}}:{{issuetype.name}}</li>
{{/}}
```

comments: author: Maroun Maroun
body: Thanks for that, missed it in my example above.
Is there a way of accessing the Primary incident link via automation?
Asked by Curt Holley:

It would be great to generate a PIR where the

Primary incident field is populated as part of the creation (via automation).  

But is that possible currently?


Answers:
author: Ste404
body: ah came here looking for the same thing. I can 'link' a Major issue via some automation but I want it to be the Primary Incident, surely this can be picked out in automation somewhere.

It's not a custom field so can't jam a smart value into it.

This has to be achievable, linking a PIR to a primary incident seems logical!


author: Bill Sheboy
body: Hi [@Curt Holley](/t5/user/viewprofilepage/user-id/3527535)

Have you tried using the how-to article below to identify the smart value of the field? My understanding is that if the smart value is present, it can at least be edited with JSON using advanced edit. And if it is absent it is not yet supported.

<https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>

Kind regards,  
Bill

comments: author: Curt Holley
body: Thanks [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)   
Good call. Though I'm having issues accessing the API currently.  
But, it isn't a JQL searchable field. Can't find it in Custom fields , Issue linking....  
So I'm doubting it ?


author: Simmo
body: Not sure I really understand the question here? There is a particular field that you want to populate?


author: Curt Holley
body: Yeah [@Simmo](/t5/user/viewprofilepage/user-id/3608665) The "primary incident" field that is only part of the Post Incident Review" issue type in JSM.


author: Simmo
body: Right and thats not appearing in the Create issue field list?


author: Michael Verdun Heath
body: I'd like an answer to this too. No it doesn't appear in the Create issue field list. I believe it's not a true field, but some kind of way linked issues are worked. The incident ticket specified gets linked as "is reviewed by", and on the PIR it shows as a link type of "Primary Incident" (this link type doesn't actually exist)... adding links alone doesn't do the trick. So what are we missing?


author: Jose Luis Lopez
body: Same issue here and we also need a solution. Any idea?


author: David Laine
body: This seems like a very obvious automation, spinning a PIR following a major Incident. I need to do this too!

Atlassian products in some areas can be frustrating sometimes, its like someone has not thought about this or completely missed something fundamental, or have just not finished the development evolution of something.

I don't understand why the "Primary Incident Link" would not be identifiable from the automation engine. Is there a workaround? Please help Atlassian!


author: Rus Yates-Aylott
body: Yes. You can create a PIR in an automation and you can create a link back to the trigger (parent) issue but in the PIR ticket view, this appears as a standard linked ticket (as with any ticket). Ideally, a linked incident case in a PIR should appear in the Primary Incident section but there does not seem to be any way of achieving this using an automation.  

Any Atlassian boffin know how to achieve this?
Details on rate limiting for workspace token
Asked by Abhishek Attri:

The documentation says all authenticated API calls have a limit of 1,000 per hour for both `/1.0/` and `/2.0/` endpoints. If I create two separate workspace access tokens from the same admin account, will they share a single limit of 1,000 calls per hour combined, or will each token have its own limit? In other words, could I potentially make 2,000 calls per hour (1,000 per token) instead of the documented limit of 1,000?


Answers:
author: Patrik S
body: Hey [@Abhishek Attri](/t5/user/viewprofilepage/user-id/1560793) ,

and welcome to the Community!

Each access token is tracked separately for the rate limits, meaning each token has its own limit allowance. So generating multiple tokens for a particular resource to increase the number of API calls available is possible and allows a better management of rate limiting ssues.

You can find additional information on rate limit troubleshooting in the following article:

* [Bitbucket Cloud Rate Limit Troubleshooting](https://confluence.atlassian.com/bbkb/bitbucket-cloud-rate-limit-troubleshooting-1319575889.html)

Thank you, [@Abhishek Attri](/t5/user/viewprofilepage/user-id/1560793) !

Patrik S


Tags: access-token

bitbucket-cloud

rate-limit