Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.
×When a document is attached on a parent ticket randomly and after its creation, it needs to be copied to all existing subtasks and linked issues.
My automation rule works mostly but the problem is that whenever it runs, all existing attachments along with new attachment are copied from main ticket to subtasks and linked issues each time, which is not desired.
Any suggestions on how to get this problem fixed?
Hi @VVC
The current Edit Issue action for the Attachments field copies all of them, and there is no way to limit that. I recall some suggestions to make that configurable for Jira Cloud but do not know if there is also a suggestion for Jira Data Center automation.
Here are workarounds I have read about, although I have not tried these:
Kind regards,
Bill
Hello @Bill Sheboy
Are there any articles or posts in regards to your proposed workarounds as to get this started and for my reference? Thank You!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the REST API approaches, here is a how-to article for calling a REST API endpoint from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828
Here is the endpoint to get an attachment by its ID: https://docs.atlassian.com/software/jira/docs/api/REST/9.13.0/#api/2/attachment-getAttachment
Here is the endpoint to add an attachment: https://docs.atlassian.com/software/jira/docs/api/REST/9.13.0/#api/2/issue/{issueIdOrKey}/attachments-addAttachment
The second approach of adding a link would just use the attachment's URL smart value, although I do not know if that exists for Jira Data Center automation rules. I could be manually created using your Jira URL and the attachment's ID.
The third approach is just a bunch of list processing and using the built-in actions. As I noted, it seems the most risky approach due to the chance of errors, so I would not initially try it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great! Thanks Bill. I will have to play a lot with the REST API approach but have to defer to later due to other competing priority Jira projects. Thanks again for your support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.