Disable the ticket creation based on requester email

Hi :grinning_face_with_smiling_eyes: !

We are building an app for freshservice, which runs in the new ticket page. We want to block ticket creation if the email domain is not a specific name.

Is there a way to disable the ticket creation, or clear the requester field?

Best Regards

Felipi Lima Matozinho

Hi Felipi,

Hope you are doing good.

Can you please brief the basic use case of your app to understand your query better?

if you want to clear the requester field then you can use the interface api

format :
client.interface.trigger(“setValue”, {id: “property”, value: “value”})
.then(function(data) {
// data - success message
}).catch(function(error) {
// error - error object
});

Regards,
Mughela Chandresh

2 Likes

Hi @Mughela_Chandresh, thanks for reply!

The app should block the agent from creating a ticket if the requester’s email is from an unspecified domain.

Through the requesterChanged event, we already get the email domain and do that validation. Now we have to block ticket creation or clear the requester field.

The setValue (API interface) does not have the option to change the requester field (and this is not a custom field). In addition we did not find the option to disable the save button (create ticket) in the docs.

image

Is there a way to accomplish this?

Regards,

Felipi Matozinho

Hi Felipi,

Can you try this way?

client.interface.trigger(“setValue”, {id: “requester”, value: “”})
.then(function(data) {
// data - success message
}).catch(function(error) {
// error - error object
});

Regards,
Mughela Chandresh

1 Like

Hi @Mughela_Chandresh!

It already worked!! Thanks :grinning_face_with_smiling_eyes:

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.