Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation for Jira -adding logic for attachments

Adrienne McCoy December 23, 2022

I have a Jira Service Management project created, and I use a linked software project to track development. With that, I copy all of the field values from the JSM issue to the linked Jira software issue using automation for jira.

Problem Statement:

An issue that I am encountering is that our JSM customers are coming back in to the JSM issue (through the portal) and adding Attachments after the initial ticket creation. The attachments are missed because they are not carried forward to the linked Jira software issue.

Solutioning:

I have looked into adding an automation to monitor for field changes in the attachments but automation for Jira does not seem to support monitoring attachment changes from the portal side (i.e. the customer is coming to the jsm portal, locating the issue, and adding the attachment through the portal). It seems to only support monitoring attachment field changes from the agent side of the issue.

Is there a different approach that anyone can recommend?

 

As an alternative, I proposed adding a comment to the linked software issue that alerts specific users when a comment is added. I feel like the rule I currently have has some room for errors because the user could create an issue that includes an attachment, then come back in later and leave a comment and the rule would still trigger.

Are there any recommendations anyone would have to improve the rule logic?

jsm.png

 

Thanks in advance!

1 answer

1 accepted

1 vote
Answer accepted
Rachel Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 29, 2022

Hi @Adrienne McCoy ,

First, let me say WOW! What an AMAZING description of the problem details. You must be a developer or tester! ;) Thanks for all those great details.

I wasn't able to get the attachment automation to work like described above either so it's time to get creative. I have an alternate idea for you to try!

How about instead of trying to copy the file over, you just copy the list of files and the date/time they were added? I know this isn't perfect (because the developer has to click over to the support ticket to see the actual attachments) but if you look at it from Jira's perspective, you'd avoid storing two copies of the same image, which might eventually eat up storage space.

I got a crude example working using the following smart tags code:

-----<START>-----

New comment added by: {{comment.author.displayName}}

Attachments in {{Issue.key}}

{{#Issue.attachment}}
* {{filename}} - Added {{created.shortDateTime}} by {{author.displayName}}
{{/}}

-----<END>-----

Here's what the simple example rule looks like in Jira automation.

attachment-monitor2.png

Note: I've unchecked the "Prevent duplicates by only adding this comment once to a particular issue." box on the bottom right.

And here's the result in a Jira issue.

attachment-monitor.png

The rule listens for new comments (see "11 seconds ago" in the image) and then automation adds another comment (see "10 seconds ago") containing a nicely formatted list of all attachments and related details. At least this way the developer can see if there's a material attachment change to be aware of.

Here's a list of all the available attachment smart values: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--attachment--

Note: The asterisk in my smart value example is there to accomplish the bulleted list formatting in the automated comment. And of course, Jira automatically adds a hyperlink for any issue IDs in comments.

I was able to link to the individual attachment files using {{content}} but that results in downloading the file locally, not displaying it in the browser.

So what do you think?

Hope this helps,

Rachel Wright
Author, Jira Strategy Admin Workbook

Adrienne McCoy January 3, 2023

Rachel,

Thank you so much for your detailed response! It was most helpful :) I ended up implementing how you described. 

 

I did find a related bug that was logged with Atlassian that is causing the issue I described with adding attachments from the customer portal not triggering automation rules (https://jira.atlassian.com/browse/JSDSERVER-8680). It is in their short term backlog, so hopefully it will be resolved soon for other folks who are experiencing this as well!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events