How to map data from email body to a field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2024 12:58 PM
I wanted to map the data from email body to incident form , i have written an inbound action script to map the assignment group and configuration item . but i don't see any value in the newly created record . although the values i am providing via email is already present in the instance .
Inbound Action script:
Please create a task with the below details
assignment:Database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2024 01:13 PM
You should be able to just check email.body.<your_field> for the values in the script. For example:
if(email.body.assignment != undefined){
current.<field_name> = email.body.assignment;
}
if(email.body.configuration != undefined){
current.<field_name> = email.body.configuration;
}
It's a good idea to add the if condition for each since there's a possibility that someone breaks the content and you might not want to print out undefined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2024 01:21 PM - edited ‎03-17-2024 01:22 PM
Hi @yunus shadman ,
You can create a variable in the email body by using a field:value pair which you can then reference in your inbound action with email.body.field
eg:
put the field:value pair below in the email body and then the script in your inbound action and the assignment group will be set to Helpdesk.
Assignmentgroup: test
if(email.body.Assignmentgroup != undefined)
current.assignment_group.setDisplayValue('email.body.Assignmentgroup')
Add CI variable and use above syntax for CI
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2024 03:44 AM
I tried in a same way , but still it is not working.