How can I identify if a incident ticket is from Now mobile app?

aimughal
Tera Contributor

I have a custom option 'Mobile App' for the field 'Contact Type'. How do I identify that the ticket is from the mobile app, currently it is being populated with 'Self Service' and i want it to auto-populate with 'Mobile App'.

3 REPLIES 3

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

There is no direct way to do it however you can do the below:-

 

Create a new variable on the record producer.

 

Create a catalog client script with the below code:-

 

var link= top.location.href;

 

Populate this value in the new variable(keep that hidden on the catalog form) now this above piece of code will only run in portal and not in you mobile so if the field return empty you know it is from mobile and map the contact type as Phone and if it comes as populated it is from Portal.

 

Please mark answer correct/helpful based on Impact.

Mike_R
Kilo Patron
Kilo Patron

I would add this logic to your record producer script.  You might need to tweak the below script.

 

var isMobile = GlideMobileExtensions.getDeviceType() == 'm'; // it's either 'm' or 'mobile'. Try both.

 

if(isMobile){

current.contact_type = 'Mobile App'; // set to your value

};

Felipe Stave
Tera Contributor

 worked for me, I appreciate it