Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to add a screenshot in an automation task?

Remy Levi
Contributor
May 26, 2023

I know how to add an image in an issue but I can t find how to add an image to an automation task. Thanks in advance for your help.Screenshot in an aotmation task.png

1 answer

0 votes
Darryl Lee
Community Champion
May 26, 2023

Unfortunately there is not a function to add attachments from within Automation. That is, you cannot add an attachment to your rule itself to then attach to issues. That would be pretty handy, but probably a nightmare to architect.

Anyways, yeah even though this documentation says:

You can copy attachments by selecting the Attachment field from the list of supported issue fields and then choosing the source issue from which attachments need to be copied.

As you likely found, it limits the source issue to related issues. In JRACLOUD-78891 I commented that it would be nice if you could Copy Attachment(s) from an arbitrary issue (like a "template" issue or a "attachment repo" issue). But there was never any response.

Here is a Suggestion you can vote for:

Now... I was trying to think if there would be a way to do this by sending a web request through the REST API but the problem is to add attachments you have to do a POST and for that you have to be able to specify a local file, and well, we're back to AUTO-454 above.

Darryl Lee
Community Champion
May 26, 2023

Ah, a related answer from the esteemed @Jack Brickey suggests you might be able to do something with a ScriptRunner post-function. 

I usually run away screaming from Groovy, but I found this article that does make it look possible:

SOLVED: attach a file using REST from scriptrunner 

The big question in my mind is whether Groovy is able to 1) grab a binary attachment (the example shows text) from "somewhere" on the Internet and 2) store it in memory (?) so that it can then actually include it in the post.

Ohai @PD Sheehan - have you ever done any work with ScriptRunner in the Cloud?

Darryl Lee
Community Champion
May 26, 2023

Hrm, this seems like it might be useful for "downloading" the file from another issue. The question is how to then "upload" it as an attachment to the new issue:

I guess perhaps you would somehow combine it with the previous post:

Bit caveat here - you'd need to pay for the Scriptrunner app.

PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2023

@Darryl Lee sorry, no. Never worked with cloud.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events