Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

[Automation] Trigger on new issue that has attachment ?


For all the documentation I have found, it is not possible to create an issue passing attachments at the same time, i.e. the files need to be attached once we have a key (correct?).

If that is the case, I wonder if an automation rule triggered by a issue creation that has a condition on the attachments not being empty, is guaranteed to work correctly, or is subjected to race conditions where maybe some times work and sometime doesn't...

Also not sure how to deal with the fact that for the customer request type in question the attachment field is set as mandatory, therefore giving me the impression I have to provide it on issue creation.

Thanks for all the help you can provide.

1 answer

0 votes

@ricardojpereira -

In JSM (Server env), attachment is not required out of the box for Request Type.  However, one can set it as required if it fits his/her needs.  You can change the Request Type form configuration to make the attachment as optional.

You are correct that in the backend that attachments are attached to the issue after the issue is created first in the system.  I don't believe one can change that behavior.  However, the automation rule triggered from "Issue Created" and then detect if there are attachment(s) or not should always work.  You may want to look into the rule definition to determine if it has any testing condition for your request type(s) since it sounded that some of your request types may set the attachments as required and some are not.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

Thanks for your answer.

The logic that I want is indeed to make attachments required on the request type form and I want the automation rule to actually trigger only if it has attachments upon creations.

If I make attachments required (as I want for form purposes), I' not able to issue create_customer_request api as it misses the "attachment" field in the fields dict. I can't see how the JSM form can use the create API with the attachment field set as required.

The second part of the question is how you can be sure that the rule triggered with "create if has attachments" can be guaranteed to work: from my perspective it shall always depend on the latency with which I call add_attachment vs the latency of the automation rule being triggered.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events