Update template value of standard change model
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 02:51 AM - edited 06-05-2024 02:52 AM
Hi,
Following a reorganization, we need to update the template values for standard change templates. This is the group value. The problem is how to identify the templates of the model concerned: I can't get the information with a report. because it is a value in a template_value
var versionGR = new GlideRecord('std_change_producer_version');
versionGR.addEncodedQuery("std_change_producer=" + stdChgRP.sys_id);
versionGR.setLimit(1);
versionGR.orderByDesc('version');
versionGR.query();
if (versionGR.next()){
var str = versionGR.std_change_proposal.template_value;
}
I don't know how I can filter in the string to retrieve only the records whose group matches a certain value.
str value exemple: "short_description=azazafaaddad"^assignment_group=azazafaaddad"^justification=sfdgdhgdgsgf"^EQ";
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 05:12 AM
You can query them from the standard change proposal table (std_change_proposal) (the last proposal will probably be the current template). Since you will need to update the proposals to get the new templates, you will need to be there anyway.
The field you need to query is the 'template_value' field, where you can check on something like template_value CONTAINS 'assignment_group=azazafaaddad' (where this is the sys_id, of course).
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark