- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 08:21 AM
I want to remove a user in an assignment group in dev and then promote to test and then prod however I know that data isnt pulled through in an update set so how do I go about promoting the change through the systems.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 09:08 AM - edited 11-26-2024 09:19 AM
Hi @joshmorris,
So with the regards as to whether it's possible to export and import XML across instances - Yes, you can.
The caveat being that the users and groups have the same sys_id across all instances.
You can also force something into an update if required with a handy little UI Action that a lot of admin will leverage in Dev.
Here's the UI Action code for you if you create a new UI Action.
However, I'd still stand with my original response, whilst you can leverage an update set ifn required or export/import XML files - I'd say this option (using XML) introduces more risk to the 'changes' as the audit history will not be accurate and if the group has a large number of users - it would require a diligent check - not just of user names, but also user sys_id's
UI Action code:
//Commit any changes to the record
current.update();
//Check to make sure the table isn't synchronized already
// var tbl = current.getTableName();
// if (tbl.startsWith('wf_') ||
// tbl.startsWith('sys_ui_') ||
// tbl == 'sys_choice' ||
// (current.getED().hasAttribute('update_synch') &&
// current.getED().getAttribute('update_synch') == 'true') ||
// (current.getED().hasAttribute('update_synch_custom') &&
// current.getED().getAttribute('update_synch_custom') == 'true')) {
// gs.addErrorMessage('Updates are already being recorded for this table.');
// action.setRedirectURL(current);
// } else {
//Push the update into the current update set
var um = new GlideUpdateManager2();
um.saveRecord(current);
//Query for the current update set to display info message
var setID = gs.getPreference('sys_update_set');
var us = new GlideRecord('sys_update_set');
us.get(setID);
//Display info message and reload the form
gs.addInfoMessage('Record included in <a href="sys_update_set.do?sys_id=' + setID + '">' + us.name + '</a> update set.');
action.setRedirectURL(current);
//}
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 08:31 AM - edited 11-26-2024 08:32 AM
Hi @joshmorris,
If this is a single user, my recommendation would be to manually remove the user from the said assignment group(s) and replicate this manual task in each environment.
Adding and removing users from groups is expected Business As Usual (BAU) behavior in all environments including Prod.
Update sets are used to capture, track and move code changes and configurations through the instance in a controlled manner.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 08:35 AM
But is it possible to do it or do I have to do it manually? Like can I export it to XML and import in test or is that not possible for changes to an assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 09:08 AM - edited 11-26-2024 09:19 AM
Hi @joshmorris,
So with the regards as to whether it's possible to export and import XML across instances - Yes, you can.
The caveat being that the users and groups have the same sys_id across all instances.
You can also force something into an update if required with a handy little UI Action that a lot of admin will leverage in Dev.
Here's the UI Action code for you if you create a new UI Action.
However, I'd still stand with my original response, whilst you can leverage an update set ifn required or export/import XML files - I'd say this option (using XML) introduces more risk to the 'changes' as the audit history will not be accurate and if the group has a large number of users - it would require a diligent check - not just of user names, but also user sys_id's
UI Action code:
//Commit any changes to the record
current.update();
//Check to make sure the table isn't synchronized already
// var tbl = current.getTableName();
// if (tbl.startsWith('wf_') ||
// tbl.startsWith('sys_ui_') ||
// tbl == 'sys_choice' ||
// (current.getED().hasAttribute('update_synch') &&
// current.getED().getAttribute('update_synch') == 'true') ||
// (current.getED().hasAttribute('update_synch_custom') &&
// current.getED().getAttribute('update_synch_custom') == 'true')) {
// gs.addErrorMessage('Updates are already being recorded for this table.');
// action.setRedirectURL(current);
// } else {
//Push the update into the current update set
var um = new GlideUpdateManager2();
um.saveRecord(current);
//Query for the current update set to display info message
var setID = gs.getPreference('sys_update_set');
var us = new GlideRecord('sys_update_set');
us.get(setID);
//Display info message and reload the form
gs.addInfoMessage('Record included in <a href="sys_update_set.do?sys_id=' + setID + '">' + us.name + '</a> update set.');
action.setRedirectURL(current);
//}
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie