- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 07:42 AM
Hi Community,
I have a script that works perfectly, apart from the fact that our incident Priority is customised as:
1-Critical, 2-High, 3-Medium
Our script is sent to an external party and needs to pull the current Priority but without the number 1 and - in from of the priority.
Example string below, which current priority, (but should obviously remove the above number and dash)
r.setStringParameterNoEscape('Priority', current.priority);
Is there a way to slice the number and dash that i can return in the above string?
Many thanks
Steve
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 09:12 AM
You're missing a bracket and semicolon after the script I provided. );
r.setStringParameterNoEscape('Priority', current.priority.getDisplayValue().match(/([A-Za-z])\w+/)[0]);
If my reply helped with your issue please mark helpful 👍 and correct if your issue is now resolved. ✅
By doing so you help other community members find resolved questions which may relate to an issue they're having.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 09:25 AM
Kieran,
Boom, absolute success, thank you so much 🙂
Appreciate your persistence on this, really appreciated.
Thanks
Steve

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 09:30 AM
You're most welcome!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 09:14 AM
So wait a minute, isn't your Priority field defined as an Integer and the display values of the choices only include text? So "current.getValue("priority")" should give you an integer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 09:24 AM
Sorry, my bad, working on too many things at once. So you want the string and not the number.