In an automation, when creating an issue, I want to check if the email received in a customfield already exists as a customer.
I think it should be something like that, but it always tells me that it doesn't exist.
"{{issue.mycustomfield}}" in (accountId("{{issue.mycustomfield}"))
What is the correct way to check if an email exists as a customer?
And to add to the query if it is a customer in a specific project?
Thanks!!
As you have the email address, the rule could call the REST API endpoint to search for a matching customer and then test the response for any found: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-servicedesk/#api-rest-servicedeskapi-servicedesk-servicedeskid-customer-get
For example, to search with the email address:
YourJiraURL/rest/servicedeskapi/servicedesk/YourServiceDeskID/customer?query=YourEmailAddressToSearch
As this is an experimental endpoint, remember to add the extra header: https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#experimental
Here is a how-to article for calling a REST API endpoint from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.