Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Check if customer exists

Francesc Juventeny
Contributor
December 16, 2024

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}"))

JIRAAUT.png

 

 

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!!

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 16, 2024

Hi @Francesc Juventeny 

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

Francesc Juventeny
Contributor
December 16, 2024

Thank you!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events