fbpx
1-888-310-4540 (main) / 1-888-707-6150 (support) info@spkaa.com
Select Page

Electric Commander (Now CloudBees CD) Transferring Homepage Settings Between Users

windchill features best plm software
Written by Carlos Almeida
Published on April 21, 2015

The Electric Commander homepage allows you to bookmark links and job configurations for easy access. It’s easy to add one or two, but if you have a lot of links and you want to share them with other users so that they have the same links as well, its a lot of work to do manually one at a time.

In this video, I demonstrate the technique for copying these settings between users and provide a script that users can download and install as a Commander plugin.

Video Transcript:

Let’s say that you have your (Electric) Commander home page set up exactly the way you want it. You’ve got links all your important places both in and outside of commander and you’ve got your job configuration set up to launch your jobs at the push of a button. Adding one or two links your setup isn’t a big deal but suppose you want to replicate all of your settings in another user’s account or worse suppose you decide you want to share your settings with an entire team. Manually recreating a set of links of any substantial size would take forever. So what do you do? First you need to know that these home page settings are stored as properties under your user name. If you pull up your user object to the web UI and run browse to the user settings property sheet you’ll see the two property sheets were interested in: Job configurations and Shortcuts. Under each property sheet is a set of further property sheets describing the links. What will be nice is to be able to use easy tools clone method to copy one users job configurations or shortcuts property sheet over to another users but unfortunately it won’t work. Clone won’t overwrite properties that already exist and even if the target user doesn’t have any job configs or shortcuts to find those property sheets are present already. The other problem is that we really don’t want to erase any settings the target user may already have defined. We want to add to their home page and not replace it. This means we have to clone each the individual entries under these property sheets for every user we want to update. So what we do is create a short script to clone each job config or shortcut individually for a given set of users. I created a working example as a commander procedure. Let’s take a look. First, note that i have three parameters: from user, to users and user settings to copy. “From user” is a simple text field where you enter a single user name from which all the settings will be copied. “To users” is a text area field that allows you to enter a new line separated list of usernames to which you would like to copy the settings. And “user setting to copy” is a radius selection that allows you to choose the setting to copy.

Now let’s look at the procedure itself. Taking a look at the procedure, we see that we have our standard easy pearl heading for a job step command. We instantiate a commander object and we store the parameters we’ve passed in. Then we execute a get properties request for the particular setting we’re interested in and use the “get setting names” sub procedure to collect the names of the properties that define each of the custom settings. Finally, for each target user we iterate over the list of settings and clone each one from the source user to the target user. The call to clone itself is enclosed in an eval block because even if the clone operation fails for some reason we want to keep going and not end up in some odd state in which half the target users don’t have the settings applied because the step failed on one operation. Instead we record which transaction failed in the log and use post p to display the number of failed transactions in the job step summary. Then you can go back later and resolve any issues individually. If we run the procedure entering admin as the “from user”, the set of 20 users recreated as the “to users” and choose shortcuts as “the setting the copy”, we see that the procedure executes. And if we login as one of these new users, they will have the same set of shortcuts as admin. If you’d like to use the procedure or modify it for some other purpose I’ve converted this project into a plug-in and have the jar available for download. Simply import and promote the plug-in jar file and a project name “SPK Utilities” will be created that contains this procedure.

Latest White Papers

The Hybrid-Remote Playbook

The Hybrid-Remote Playbook

Post-pandemic, many companies have shifted to a hybrid or fully remote work environment. Despite many companies having fully remote workers, many still rely on synchronous communication. Loom offers a way for employees to work on their own time, without as many...

Related Resources

Measuring the Impact of AI on Product and Development Teams

Measuring the Impact of AI on Product and Development Teams

Generative AI is transforming the software development industry, enabling teams to develop, secure, and operate software more efficiently. GitLab is no exception. Its AI-powered suite, GitLab Duo, aims to optimize workflows across the entire software delivery...

Maximizing Efficiency with a RACI Matrix

Maximizing Efficiency with a RACI Matrix

For years, I’ve enjoyed working with clients on difficult projects. In my early career, I did a lot of work for a cloud and infrastructure company where I mainly worked with internal teams.  However, when I did get the chance to work with external clients, I found...

Seamlessly Transition from AWS CodeCommit to GitLab

Seamlessly Transition from AWS CodeCommit to GitLab

In July of 2024, AWS announced that AWS CodeCommit would no longer be sold to new customers.  And thus begins the journey of winding down a product for AWS.  As AWS CodeCommit approaches its end-of-life, many organizations face a tough decision. Choosing where to...