If you’ve configured your instance to create issues through email requests, this article explains how to automatically assign newly created issues (through email requests) to a specific user - based on the keywords in the email subject/email body - using the Update Any Issue Field (JSU) post-function.
Use cases:
How to compare the value of a text field using a Regular Expression pre-condition(JSU).
How to assign the issue to a specific user using Update Any Issue Field (JSU) post-function
Instructions
Example use case: If the email has 'Dev' or 'QA' in the subject, the ticket needs to be assigned to user1. If it has 'Deploy' or 'Prod', it needs to go to user2.
Login as Jira Admin and edit the workflow that is associated with your project and issue type.
Select the Create transition and then select the Post Functions tab and click Add post function.
Select “Update Any Issue Field (JSU)” post-function and click Add
In this, add two Regular Expression pre-conditions: One for Dev and another for QA, and add the below regular expressions:
For Dev :^[\s\S]*Dev[\s\S]*$
For QA :
^[\s\S]*QA[\s\S]*$
Select "OR" in the pre-condition section and select “True” under “Preconditions must be”.
Select the Assignee field and add the account id of user1 in the Field Value. Refer to the screenshot below:
Click “Add”.
Similarly, add another Update Any Issue Field (JSU) post-function on the Create transition for 'Deploy', 'Prod' and add the account id of user2 in the Field Value and publish the workflow.
If you want to verify the email body instead of the subject, then replace Summary with Description in the Regular Expression pre-conditions.
Place these post-functions below “Creates the issue originally.” built-in post-function on the create transition.
It is recommended to test this scenario in a non-production environment, before implementing it in a production environment.