Context: I’m setting up an automation rule in Jira Service Management (JSM) to handle incoming emails. The objective is to check if the email body contains a specific issue key (formatted as JSM Number: VPLSRV-xxxxx
). If the issue key is found, I want to add the work notes from the email as a comment on the existing issue. If no issue key is found, a new issue should be created.
Number: ABC123
JSM Number: ABCD-149
Work_notes: More info added
Work_notes:
as a comment on the issue.ABCD-xxxxx
) from the email body.Work_notes
from the email as a comment on the existing issue.Hi @Nithin Revanna and welcome to the Community!
Could you take a step back for a second and explain how you got to the idea of trying to write an automation rule for this?
You seem to be trying to replicate the behaviour Jira's email handler is doing by default. If an email arrives in a connected mailbox, Jira will check if it references an existing issue and - if so - attach the email body as a comment to that existing issue. If no reference to an issue is found in the email, a new issue will be created.
As far as I know, there is no such thing in Jira automation as a trigger on email received. In your screenshot, you reference the Issue created event. If this was indeed an issue raised from an email channel, that means that there was no reference to an existing issue found in the first place and everything else you are trying to do after that has no point anymore, since you will never find a related issue in there. Unless of course people add random references to issue keys in emails about other issues. And that would be the part I am interested to understand 😛
Hope this helps!
Adding to the above; when you want to add a comment to a related issue, you need to use a branch on related issues, not to the current issue. The following frame setup might work (though it would probably require some tweaking for checking the condition):
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.