Use case
Add a comment to the current issue with links to the attachments that were recently added. The time between the transition and the moment when the attachments are added will define if the issue was added recently. The length of this time span can be modified in the expression.
🛠️ Configuration
Target issue*
Choose Current issue
Comment text*
Use the following expression with the expression editor set to Jira expression:
"Attachments added: " + issue.attachments.filter(attachment => attachment.created > new Date().minusMinutes(2)).map(attachment => "\n[" + attachment.filename+ "|https://jwtcum.atlassian.net/secure/attachment/"+attachment.id+"/"+attachment.filename+"]").reduce((myString, current) => myString + current, "")
Add a comment with the links of the attachments that were added two minutes before the transition.
Replacing the number 2 with another number will allow you to modify the length of the time span established in the expression, increasing or decreasing it in minutes.
Comment author*
Select Current user.
Comment visibility*
Choose Unrestricted (all users).
📚 Related use cases
| Use case | Workflow function | Use case description |
|---|---|---|
| Alert the assignee of important issues |
Add a comment to an issue mentioning the assignee. The comment will only be added, if the issue priority is set to "High" or "Highest" to ensure that the assignee will only be alerted for the important issue |
|
| Add formatted comments automatically |
Add a formatted comment to the current issue. It would be convenient in case that you need to create a table or highlight some important points in the comment. |
|
| Add a comment with links to attachments that were just added |
A comment will be added to the current issue with links to the attachments included recently. |
|
| Push status updates to the linked Epic |
Add a comment to the linked Epic including the summary and status of the current issue. This is helpful when you don't want to keep track of individual Stories and only receive notifications of the linked Epic (e.g. as a watcher or reporter). |
|
| Push status updates to the parent |
Add a comment to the parent issue including the summary and status of the current issue. This is helpful when you don't want to keep track of individual sub-tasks and only receive notifications of the parent issue (e.g. as a watcher or reporter). |
|
| Add a comment when rejecting an issue |
When an issue is rejected, a comment will be added to the current issue mentioning the reporter. |
|
| Alert the reporter |
Add a simple comment to an issue mentioning the reporter. This use case might come in handy if you don't want to use extra events in your notification schemes to notify specific users - like the reporter. |