I have a use case where I am sending in emails to Jira service management to create tickets. Those emails will have multiple attachments and I want to add a system where I can count the # of attachments as the # of tasks. Kind of like a weighting system i.e. One task may have 3 attachments so it's weighted as 3 vs a task that only has 1 attachment weighted as 1. I am appending the # of attachments in the email subject line in a standard way which flows into the summary of the Jira ticket. My question is how do I extract that number from the summary so I can use automation to apply it to a custom field I created?
Hi @Marcus Jones - another option is to simply count the number of attachments, using the smart value: {{attachment.size}}
The trick is that the "Issue Created" trigger will probably fire before all of the attachments are attached.
Yup - the first time I did this I got 0.
So I pulled the old "Re-fetch issue data" trick and that seemed to do it:
It'd probably be good to have some kind of keyword or something in the Subject/Summary to make sure we know it's an issue coming in via email instead of directly in Jira.
Oh, and you'll want to test with big attachments, etc. to make sure it's always getting the count right, regardless of file size, etc.
I really like this way of doing it as well actually, it makes it so I don't have to append the # of attachments in the summary field keeping it cleaner. Issues come into this project only via email so I shouldn't have an issue with issues being created by agents or in the portal.
Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Welcome to the community
You can try to use the substring function with Automation
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This was helpful thank you! I ended up surrounding the # with * and used this expression to extract:
{{issue.summary.substringBetween("*","*")}}
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.