- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 11:06 AM
Hi All,
I have created a UI action to convert existing incident record to ENHC (enhancement record).
I want to map the value of cmdb_ci field on INC form to Application field on ENHC form.
The problem is we have many to one mapping here. We can have several servers in cmdb_ci field which we have to map with a particular application field on ENHC.
I have written below script but it doesnot seem to work. Please let me know what i am doing wrong here.
if ((current.cmdb_ci.getDisplayValue().indexof('ABC')) || (current.cmdb_ci.getDisplayValue().indexof('DEF')) >-1) {
task.u_application = '58107c254f1e9700faa3ee6d0210c712';
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 12:23 PM
Hi,
Two mistakes I saw in your code is:
1. Missing >-1 at first indexof
2. Replace indexof with indexOf. O should be capital.
Hope this helps!
Thanks,
Archana

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 11:14 AM
you can do something like
current.cmdb_ci.nameLIKEABC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 12:23 PM
Is there anything wrong with this code? This is written in an UI action and is not working.
if (current.cmdb_ci.nameLIKEALV) {
task.u_application = '58107c254f1e9700faa3ee6d0210c712';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 11:39 AM
This is not working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 12:23 PM
Hi,
Two mistakes I saw in your code is:
1. Missing >-1 at first indexof
2. Replace indexof with indexOf. O should be capital.
Hope this helps!
Thanks,
Archana