youngmon/atlassian-qna huggingface dataset:
When importing multiple scan to JSM from cloud, the existing data is overwritten.
Asked by Harla Batinovic:

I have two servers running Discovery Tool scans. They are uploaded via the cloud to the same Schema in JSM. They use the same token on both servers for the transfer. There is no overlap of servers being scanned.

Server 1:

* LINUX scan of 6 servers at 12:05 AM - takes about 5 minutes to scan
* Win scan of 6 servers at 12:20 AM - takes about 5 minutes to scan
* Win scan of 60 servers at 12:40 AM - takes about 2 hours to scan

Server 2:

* Win scan of 6 servers at 12:15 AM - takes about 5 min
* Win scan of 56 servers at 1:00 AM - takes about 2 hours

All 5 server scans are imported into the same schema in JSM. However, when I look after they are completed, many of the status in Host tab say NOT FOUND.

It appears only last scan is showing the results and deletes the results from the other imports.

Has anyone else had this issue and how did it get resolved?


Answers:
author: Kristen Riddle
body: It sounds like you're dealing with an issue where multiple Discovery Tool scans are being imported into the same schema in Jira Service Management (JSM), and the results are overwriting each other. The "NOT FOUND" status likely means that when the last scan is imported, it replaces the data from the previous scans instead of merging it.

By making a few changes to how you're handling imports and data, you should be able to prevent one scan's results from overwriting another's. Hopefully, this helps you get to the bottom of the issue!


Tags: assets-discovery

cloud

jira-cloud

jira-service-management

jira-service-management-cloud
Make attachment generated by API visible to customer
Asked by Dan Foster:

We have a ticketing system where a user assembles a chart within our website and submits a ticket, our website then via the API converts that chart into an excel table and attaches the table to the ticket it creates via an internal comment.

We would like those attachments to be visible to customers within the portal, however they are not currently because the API is attaching via an internal comment.

We however don't want the API to attach via a "reply to customer" as we use customer notifications and don't want an email sent when the API attaches this excel chart.

Is there any way we can make these attachments visible to customers? Either by keeping the comment as internal but making the attachment visible, or making the comment not internal but preventing a customer notification sending when this comment is made?


Answers:
author: Jim Knepley - ReleaseTEAM
body: I would need to experiment to see if this would work, but you could try to append the table to an existing comment and turn off the notification of "Public comment edited" events.

There are some contradicting answers if you can change a comment from "internal" to "public" after it's been created, and I don't know if that would trigger a notification; I'll say [maybe](https://community.atlassian.com/t5/Jira-Service-Management/REST-API-update-Comment-to-internal/qaq-p/1483037) on that idea.


Tags: cloud

jira-service-management

jira-service-management-cloud
Virtual agent and Slack
Asked by Rob Carnesecca:

I'm using the Virtual agent with Slack but hate that everyone in the org can dogpile into the thread and overwhelm chatbot or confuse the agent. Is there any way to have the conversations only interact for the user to see and not be public?


Answers:
author: Tuncay Senturk
body: Hi [@Rob Carnesecca](/t5/user/viewprofilepage/user-id/1391684)

Welcome to the Community!

I am not an expert on this, so please take it with a pinch of salt.

1. Is there a way to interact with the virtual agent through direct messages instead of a public or private channel?

2. Some virtual agents or custom Slack bots can be configured to ignore messages from users other than the original author in the thread.

I hope it helps!

comments: author: Rob Carnesecca
body: Thanks for getting back to me... I'm using the newish Virtual Agent found in the project settings, I do not see any setting to adjust the way that slack interacts with the native Virtual agent, do you happen to know if I'm missing something or should look for the setting in another place?


Tags: cloud

jira-service-management

jira-service-management-cloud
How to Copy Attachments from the Latest Comment to Linked Issues in a ScriptRunner Script?
Asked by Sophie:

Hi everyone,

I'm working on a ScriptRunner script in Jira that automatically copies the latest comment and its associated attachments from one issue to all linked issues in the `SUP` project.

I've successfully managed to filter out the relevant attachments that are mentioned in the latest comment, but I'm stuck on how to actually copy these attachments to the linked issues.  
Here's the part of my script where I'm trying to figure out what to do next:

```
import com.atlassian.jira.component.ComponentAccessordef attachmentManager = ComponentAccessor.attachmentManagerdef commentManager = ComponentAccessor.commentManagerdef comments = commentManager.getComments(issue)def latestComment = comments.last()def allAttachments = attachmentManager.getAttachments(issue)def latestAttachments = allAttachments.findAll { attachment ->    latestComment.body.contains(attachment.filename)}def issueLinkManager = ComponentAccessor.issueLinkManagerdef linkedIssues = issueLinkManager.getOutwardLinks(issue.id).collect { it.destinationObject }linkedIssues.each { linkedIssue ->    if (linkedIssue.projectObject.key == "SUP") {               latestAttachments.each { attachment ->            // What should I add here to copy the attachments to the linked issues?        }                commentManager.create(linkedIssue, latestComment.authorApplicationUser, latestComment.body, true)    }}
```

Could someone guide me on what to write in the `latestAttachments.each` block to properly copy the attachments to the linked issues? Any help or examples would be greatly appreciated!

Thanks in advance!


Answers:
author: Tuncay Senturk
body: Hi [@Sophie](/t5/user/viewprofilepage/user-id/5567600)

Welcome to the Community!

Here is some code that may shed some light, though it hasn't been tested. I hope it helps you achieve your goal.

```
linkedIssues.each { linkedIssue ->
   if (linkedIssue.projectObject.key == "SUP") {
      latestAttachments.each { attachment ->
         def file = attachmentManager.getAttachmentFile(attachment)
         def inputStream = Files.newInputStream(file.toPath())
         try {
             CreateAttachmentParamsBean bean = new CreateAttachmentParamsBean.Builder().
                file(file).
                filename(attachment.filename.
                issue(issue).
                author(attachment.author).
                build();
             attachmentManager.createAttachment(bean);
         } finally {
            inputStream.close() 
         }
      }

      commentManager.create(linkedIssue, latestComment.authorApplicationUser, latestComment.body, true)
   }
}
```

comments: author: Tuncay Senturk
body: This is the import statement you will need

import com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean;


Tags: data-center

jira-service-management

jira-service-management-data-center
SOLVED: How would you update an Asset object without going through a linked issue?
Asked by C_ Derek Fields:

Environment {#toc-hId--348815406}
---------------------------------

* Invoice Object Type with a "Total" field
* Line Item Object Type with an "Amount" field and a reference to an Invoice Object

Problem {#toc-hId-2138697427}
-----------------------------

A user creates a new Line Item object. I want to increment the Total field on the referenced Invoice with the Amount on the Line Item. I do not want to have to go through a linked issue.

How would you implement this?


Answers:
author: Kris Dewachter
body: Hi [@C_ Derek Fields](/t5/user/viewprofilepage/user-id/41090) ,

You could create an automation rule that is triggered upon the creation of a new Line Item object.

In the automation rule, you get all Line Items via an AQL statement, loop though the results and make a sum.

Best regards,

Kris

comments: author: C_ Derek Fields
body: I will try that - thanks for the suggestion.


author: C_ Derek Fields
body: [@Kris Dewachter](/t5/user/viewprofilepage/user-id/4588367) - Just a note that in order to make the summation work, I needed to join and split the Amounts in the list, like this:

```
{{lookupObjects.Amount.join(":").split(":").sum}}
```

I provide that in case you ever need to do something similar. Apparently, just using "sum" on the list doesn't work for reasons that I don't understand.

However, the problem that I really want to solve is to update an object that is not the object that triggered the rule. The only way I can see that I can update a referenced object attribute is to do it through an issue whether that object is referenced.

What would be ideal would be an Assets action that would take an Object Schema and Object Key (as a smart value) and let me update the attributes. However, that doesn't exist. I can only update the object that actually triggered the automation.

Any other ideas?


author: Kris Dewachter
body: Hi [@C_ Derek Fields](/t5/user/viewprofilepage/user-id/41090) ,

Have you tried creating a AQL branch in the automation rule to get the object you need, and use the "Update Object" action in that branch?

Best regards,

Kris


author: C_ Derek Fields
body: [@Kris Dewachter](/t5/user/viewprofilepage/user-id/4588367) - Thanks for the suggestion. That very well may work - I wasn't thinking in terms of AQL branch setting the {{object}} smart value. That should get me where I want to go.


Tags: assets

automation

cloud

jira-service-management

jira-service-management-cloud
Jira Automation: Related issues condition find linked issues from another project
Asked by David Leal:

I was trying to use Related issues conditions and I realized that I am able to find linked issues from the same project on a given issue, but not when the linked issue is from another project. I found the following related question: [Search for issues in other projects and automatically link them when at least one component matches](https://community.atlassian.com/t5/Automation-questions/Search-for-issues-in-other-projects-and-automatically-link-them/qaq-p/2027877) and per the answer provided by [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) it will require a global/multi-project scope rule.

I am wondering if there is no need to have a global/multi-project scope for that, This will require getting involved my Jira admin and then I cannot edit the rule, I would depend on a third party to edit it. It is very unfortunate that Jira Automaton has such limitations.

Thanks,

David


Answers:
author: Fabian Lim
body: Hi [@David Leal](/t5/user/viewprofilepage/user-id/1567948)

Unfortunately, you will have to get your sys admin involved. Any time you are using a condition, branch, action, in another project it has to be a global configuration.

Regards,

Fabian

comments: author: David Leal
body: thanks, [@Fabian Lim](/t5/user/viewprofilepage/user-id/3131564) I was able to find a workaround, I guess the only exception is the Clone issue action that allows me to clone an issue on a different project, so It took that approach, and then while cloning to set the values I wanted.

My initial approach was trying to look at linked issues after cloning the issue with one rule, and with a second rule to update the values for the cloned issue, but because I wanted to clone from one project to another the linked issue was from another project, so I could not find it. Now I have all the processes in a single rule, cloning and at the same time updating the fields from the trigger issue. Thanks

![Screenshot 2023-08-27 at 4.57.37 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/277414i4ACCD9224A0745DA/image-size/large?v=v2&px=999 "Screenshot 2023-08-27 at 4.57.37 PM.png")

and for example to set the values as follows for bugs created in another project.

![Screenshot 2023-08-27 at 5.10.47 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/277415iB13D0BB946B0EBE0/image-size/large?v=v2&px=999 "Screenshot 2023-08-27 at 5.10.47 PM.png")


author: Fabian Lim
body: Correct, as long as you are creating/cloning tickets in another project it doesn't need the global admin rule. You only need to make sure that whoever is executing the rule (user/automation) has access to create ticktets in the other project.
Move card to top of column after transition of status
Asked by Raphael Fernandes:

I want to move a card to the top of the TODO column when moving the card from "Reviewed" column to "TODO

![Captura de tela 2023-08-25 140936.png](https://community.atlassian.com/t5/image/serverpage/image-id/277248i453953D9C55B2282/image-size/large?v=v2&px=999 "Captura de tela 2023-08-25 140936.png")

Is there a way for doing this using Jira web interface? I am learning the automation tools and I was able to find a way to make the status change trigger, but none of the actions seemed to be the one I am looking. This would be very usefull since the card is beeing moved to the bottom of the column. If there is no way for doing this with in the interface, I'll police myself to move the card insted of changing the status directly on the card such as in the previous image


Answers:
author: Bill Sheboy
body: Hi [@Raphael Fernandes](/t5/user/viewprofilepage/user-id/1872096)

That is possible in an automation rule, although it is a bit complicated...

Let's assume your Jira board uses a filter based on ORDER BY Rank ASC, which is the default sort order to allow drag-and-drop of issues on the board. And so the thing you need to change is the Rank.

But Rank (also known as LexoRank) is not a simple number value, and so the way to re-order things programmatically is *relative to one another*, calling a REST API function.

And so an outline of the steps to do this is:

* find the issue currently at the top of the TODO column, using JQL, and store that with the Lookup Issues action
* call the REST API function to rank issues, passing your new issue and the one at the top of the TODO column

Some references to get you starting on trying this are...

Calling a REST API function with an automation rule: <https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828>

The specific REST API function for ranking issues: <https://developer.atlassian.com/cloud/jira/software/rest/api-group-issue/#api-rest-agile-1-0-issue-rank-put>

Kind regards,  
Bill
Show all changed content on a page to a User since the last time he viewed it
Asked by Jeremy-Joey Jakobi:

Hi,

Is there a way to show a viewer what has changed on a page since the last time he visited it?


Answers:
author: Avinoam
body: Yes! at the top of every page you and your users can click this and see any changes.![Screenshot 2023-08-28 at 1.43.31 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/277601iB7434A663674CE3E/image-size/large?v=v2&px=999 "Screenshot 2023-08-28 at 1.43.31 PM.png")

comments: author: Rick Westbrock
body: Is that in Confluence Server? We are in Cloud and I don't see the "No updates" indicator.
Automation of Status of parent task based on status of its subtasks
Asked by Mourad Siala:

Hi all,

I would like to automate the Status transition of my Tasks based on the status of their subtasks. There are 4 Status in total: "Blocked", "To Do", "Done", "In Progress".

Here should be the rules:

* As soon as there is a Subtask changes status,
* Search for its parent task and change its status with following rules:
  * If at least one subtask is "Blocked", The parent Task is "blocked"
  * If status of all subtasks is not "blocked" and at least one sub-task is not "to do", then status of parent task is "in progress"
  * If status of all sub-tasks is "done", then status of parent task is "done"
  * if status of all sub-tasks is "to do", then status of parents task is "to do"

Is that doable?


Answers:
author: Bill Sheboy
body: Hi [@Mourad Siala](/t5/user/viewprofilepage/user-id/5301776)

Beyond the scope of your question...Please consider using the issue "flag" feature (or other Jira feature) to indicate blocking rather than having a status for that condition.

In my experience, when teams add "Blocked" as a status to their board, they are accepting "blocked" is a normal condition rather than as something which is unusual. And so they are less likely to reduce the number and frequency of blocking things. Instead they grab another work item, increase their amount of work-in-progress (WIP), and so slow down delivery. Using the issue flag instead makes the condition highly visible, and temporary.

Perhaps discuss this with your team and scrum master / coach to learn their thoughts on this approach. Thanks!

And if you are concerned about having the parent issue reflect the progress of the child items, it is also possible to set / clear flags using automation rules.

Kind regards,  
Bill

comments: author: Mourad Siala
body: Thanks for the tipp, Bill!


author: Mourad Siala
body: Hi Aron!

This seems to work, thanks!

One question though: How to enter the conditions on sub-tasks?

For example, how to say if sub-task match status "Blocked"?

comments: author: Aaron Coonce
body: Under "New Condition" there should be option for:  
"Related Issue Conditions".  
Select Related Issues "Subtasks"   

From there there should be a "Condition" box   

If you choose any of the JQL option you will get another box for a query  
For example:  

status = "Done"

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


author: Mourad Siala
body: Hi Aaron, thanks a lot! This works exactly as I want it.

Regards


author: Aaron Coonce
body: Siala,  

I drew something up for you let me know if this helps. Please note I am on Data Center.

![Automation for Siala.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/277194iE92AF6421DA8DE61/image-size/large?v=v2&px=999 "Automation for Siala.PNG")
How do I sum the original estimates of all the linked Tasks under a Story?
Asked by Abhishek:

Consider the following scenarios:

* Story A
  * Task 1
  * Task 2
  * Task 3

Where three tasks are linked under one story. I am trying to figure out a way to automate the calculation for Original estimates of Story A. Every time a ticket is linked to the story OR every time the original estimate is updated of one of the linked tasks, I want to update the Original Estimate(OE) of the story as:  
OE of Task 1 + OE of Task 2 + OE of Task 3  

Any leads on how to achieve this will be appreciated!  

<br />


Answers:
author: Bill Sheboy
body: Hi [@Abhishek](/t5/user/viewprofilepage/user-id/5073657)

There are many community posts for this scenario, such as the ones listed under the "Related Community Content" on this question's page. Please take a look at this one as an example:

<https://community.atlassian.com/t5/Jira-Software-questions/Summing-up-story-points-from-Linked-tasks-to-story/qaq-p/2448964>

And if you are just starting to learn about automation rules, please refer to these documentation and example sources:

* <https://www.atlassian.com/software/jira/guides/automation/overview#what-is-automation>
* [https://www.atlassian.com/software/jira/automation-template-library#/rule-list?systemLabelId=all\&page=1\&pageSize=20\&sortKey=name\&sortOrder=ASC](https://www.atlassian.com/software/jira/automation-template-library#/rule-list?systemLabelId=all&page=1&pageSize=20&sortKey=name&sortOrder=ASC)
* <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/>
* <https://support.atlassian.com/jira-software-cloud/docs/use-advanced-search-with-jira-query-language-jql/>

Kind regards,  
Bill


author: Abhishek
body: Thanks [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)
Stakeholders Automation for Discovery Projects
Asked by RSavage_stellarindustrial_com:

We started using the paid version of the discovery project to organize the projects for my IT team. There is a standard field for stakeholders but I do not see any automation rules that allow us to tag the stakeholders.  

I want to automate emails to the stakeholders when a project status changes, if comments are posted and other changes to the project. Has anyone figured out how to do this?


Answers:
author: Bill Sheboy
body: Hi [@RSavage_stellarindustrial_com](/t5/user/viewprofilepage/user-id/4276797)

What have you tried thus far to solve this?

I believe you can still add people as watchers or mention them in comments with automation rules for JPD projects, the same as other project types.

Kind regards,  
Bill

comments: author: RSavage_stellarindustrial_com
body: I tried finding rules for stakeholders and couldn't find anything. I was hoping I was missing something that is already set up and that I couldn't find. I think you are correct that the @mentions will work but i want to also give them updates when the status changes. What I might be able to do is create or display the "reporter" and use that field to have the stakeholders name. It is just unfortunate that the automation rules don't seem to have specific automation for discovery ideas.


author: Bill Sheboy
body: Jira Product Discover (JPD) projects appear to be based team-managed projects...with a lot more features and views. And in my experience all the basics of automation rules worked with JPD projects. Certainly there are opportunities for Atlassian to add more automation features, tailored around JPD-like features :\^) Until then...

If you can add those stakeholders as Watchers, that may be enough. If you want specific communications for them, you can use the Issue Transitioned trigger to email them using the Reporter field...But there may be a problem:

My understanding is [any custom People field for team-managed projects cannot work in rules to send emails](https://jira.atlassian.com/browse/AUTO-519). So you may need to stick with the built-in fields like Reporter, or use mentions.


author: RSavage_stellarindustrial_com
body: Adding them as watchers is a great idea. Thank you for the suggestion. I appreciate it.