Inbound action to pull text from subject and enter into field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 03:41 AM
Hi All,
I have some inbound actions set up for till alerts that we receive. An example of the subject is 'POS:SELF-T1183-9999-843-HTTP Connector'
I need to extract the 'T1183' from the subject and enter it into the the Configuration Item field on the Incident table. The 'POS:SELF-' should always remain the same. The rest of the subject will change depending on the till and alert.
Can anyone help with the scripting please?
Kind regards,
Hinakshi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 03:46 AM
Hi,
Use the email.subject Contains the subject of the email as a plain text string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 04:15 AM
Please try this in your code
var str = "POS:SELF-T1183-9999-843-HTTP Connector!";
var res = str.substring(9, 14);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:23 AM
Hi
You can use
var data = email.subject;
Kind regards,
Manas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:41 AM
Hello Hinkanshi,
You can fetch it like below:
var subject = 'POS:SELF-T1183-9999-843-HTTP Connector';
var outputValue = subject.split('-'); // it will split a string after every -. Array index starts with ZERO
gs.print("1 st element: "+outputValue[0]); // here 0 Zero is index
gs.print("outputValue: "+outputValue[1]);// here 1 ONE is index
Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies
Abhishek Gardade