Hi,
We are using an email to create issues in jira. Those emails have as subject "TITLE#Issue title#USER$anuser@email.com$".
Then we have an automation that triggers when an issue is created, if the subject contains an "@", then:
- Adds a customer to the project using "{{{issue.summary.substringBetween("USER$","$")}}}"
-After that, I want to assign also the new issue to the user that has the email written in the summary, I am using this code but it is not working:
{
"set": {
"assignee": {
"set": "{{{issue.summary.substringBetween("USER$","$")}}}"
}
}
}
I think I need the accountID of the user in order to assign the issue to him, I tried sending this web request, but it is not working, I get a "bad request 400":
Webhook URL: https://<put-your-sitename-here>.atlassian.net/rest/api/3/user/search?query={{issue.summary.substringBetween("USER$","$").urlEncode}}
Can anyone tell me if I am missing something? Thank you in advance.
Regards
Hello @Alejandro Moreno
Everything seems logical including the endpoint to get the account ID. so unless we see Audit logs we can only suggest steps and ask what response you are seeing.
https://<put-your-sitename-here>.atlassian.net/rest/api/3/user/search?query={{issue.summary.substringBetween("USER$","$")}}
https://<put-your-sitename-here>.atlassian.net/rest/api/3/user/search?query=myemail.com
https://<put-your-sitename-here>.atlassian.net/rest/api/3/user/search?query={{issue.summary.substringBetween("USER$","$")}}
Hi @Kalyan Sattaluri ,
Thank you for your reply, I will answer you below:
Yes, and same outcome, "bad request 400"
Yes, I get the correct response from the browser with that url.
Yes, the email is extracted correctly.
It is not, the string is logged as it is written, not the response. I attach an image:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It was an error in the web request's authorization header. I fixed it and now it works.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
When dynamically building a URL for the Send Web Request action, any errors or timing problems could lead to errors.
I recommend:
This approach will also solve any timing problems to fully define the URL before it is used.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Alejandro Moreno
You added tags to your post to indicate this is for Jira Service Management. Can you confirm that you are creating issue in a Jira Service Management project from email?
If that is true, are you using the native Jira Service Management email processing, or some different process to create the issues?
Do I understand correctly that you are create a Jira Service Management Customer user account from the information in the Summary of the email? And you are creating that account based on the information in the Summary that appears in the place indicated by anuser@email.com?
Do I understand correctly that you are then trying to set the Assignee field of the issue to the Customer you created? If so, that is not allowed. You can set the Assignee field only to licensed JSM Agents. You cannot set the Assignee to a user who is only a Customer of your JSM instance. You can instead set the Status of the issue to something that indicates that the Customer needs to provide information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Trudy Claspill ,
Thanks for your reply. Yes, I am creating the issues in a JSM project (team managed), and I am using the native JSM email processing.
The emails written in the summary will belong to licensed JSM agents, so that should not be the problem
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.