Property value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 03:57 AM
Hey
I have a business rule code
who accesses a suitable property in any condition.
I want to add a line to the code that will extract the value from the property that returns in line 24
The code:
I would be happy to help
Thanks Shir

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 04:11 AM
@Shir Sharvit Here is the updated code..
(function executeRule(current, previous /*null when async*/ ) {
var property;
var reduced_priority;
if (current.priority == 1) {
property = 'critical_response_sla';
reduced_priority = 2;
}
if (current.priority == 2) {
property = 'critical_response_sla';
reduced_priority = 3;
}
if (current.priority == 3) {
property = 'critical_response_sla';
reduced_priority = 4;
}
if (current.priority == 4) {
property = 'critical_response_sla';
reduced_priority = 4;
}
var propVal = gs.getProperty(property); //This will fetch the assigned property value
gs.addInfoMessage(propVal); //Shows the property value using an infoMessage.
var time = 18;
var dt = new GlideDateTime();
dt.addDaysLocalTime(time);
gs.eventQueueScheduled("incident.priority.reduce", current, current.priority, reduced_priority, dt);
})(current, previous);
I have defined a new variable propVal which captures the property value. You can use this variable later on to use it in your script.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 04:14 AM - edited 06-18-2024 04:15 AM
Hey
I want to extract the value of the Property,
Do not display it in infoMessage

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 04:18 AM
gs.getProperty('property name');
Is used to extract the value of the property.
In the code
var propVal = gs.getProperty(property);
The variable propVal holds the value of property.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 04:28 AM
@Shir Sharvit Please mark the response as accepted solution if it addressed your question.