
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
The Demand Workbench provides a central location for viewing and assessing business demands via a bubble chart. One way to grab a quick view of this bubble chart is to navigate to a list of Demands or 'My Demands', select a few or all of the listed Demands, and in the bottom Related Links, select 'Demand Workbench'
Out of Box, the Bubbles or circles seen on the chart are managed by 3 planes: X Field, Y Field and Z Field. You may inspect these OOB configurations by navigating to bubble_chart_workbench.list and inspect the records there.
By default, the fields that are utilized for Bubbles in the Demand Workbench are:
- X Field: Risk (score_risk)
- Y Field: Value (score_value)
- Z Field: Size (score_size)
*The above may be configured to fit your needs, however, be sure that the field is a Type of 'decimal'.
====
T-Shirt size is a choice field on the Demand table that acts as a rough indicator for Users to note the expected amount of work a Demand might take. On a handful of occasions, I have heard of interest in having the T-Shirt Size field be utilized in the Demand Workbench bubble chart, specifically, to dictate the size of the Bubble, or Z Field.
The problem is that the T-Shirt size field (size) is a String type, so it cannot be used in the Demand Workbench.
*One confusing aspect I have seen noted a few times is that the column name of 'T-Shirt size' is the same as another field's column label. It may appear to some that T-Shirt size is already used as the Z Field of Demand Workbench, however, the 'Size' field and the 'T-Shirt size' field are two different fields. Below, are the Column labels of fields followed by their column name, in parenthesis.
- T-Shirt size (size)
- Size (score_size)
In order to have the T-Shirt size dictate the Z Field - or size of bubble - in the Demand Workbench, I wanted to offer the following customization, which in short, requires the use of a NEW Decimal field, a Background Script to copy existing T-Shirt size data into decimals, updates to the existing bubble_chart_workbench config records and in order to make sure future Demands consider copying the T-Shirt size string values to a NEW decimal field, a few Business Rules! While it may seem like a lot, the following steps are very simple!
1. First, Create a new, decimal type field on Demand. In my example below, I have created a decimal field called 'T-Shirt Decimal'. It is crucial that the field is a decimal type. Also, note down the column name of your created field, if you wish to name it something different. *The great thing about this process is that you can hide this field after completing this step-by-step process so users ONLY need to focus on the OOB T-Shirt size field.
2. Now, in Scripts - Background, we need to run a script that looks at ALL existing Demands and updates your new Decimal type field based on its T-Shirt size value. In other words, for all Demands where T-shirt size=small, set the new Decimal field value to '2'*
*You may alter the script below to include decimal/integer values that meet your needs. Also, if the column name of your new Decimal type field is different than mine, you will need to update that in the script for every if statement. HIGHLY RECOMMENDED: Run this script in a SUB-PRODUCTION first to ensure that your code is correct.
- Navigate to Scripts - Background and run the following script:
var gr = new GlideRecord('dmn_demand');
gr.query();
while(gr.next()){
gr.setWorkflow(false);
if(gr.size == 'small') {
gr.setValue('u_t_shirt_decimal','2');
} else if (gr.size == 'medium') {
gr.setValue('u_t_shirt_decimal','4');
} else if (gr.size == 'large') {
gr.setValue('u_t_shirt_decimal','6');
} else if (gr.size == 'xlarge') {
gr.setValue('u_t_shirt_decimal','7');
} else if (gr.size == 'xxlarge') {
gr.setValue('u_t_shirt_decimal','8');
}
gr.update();
}
3. Configure Demand Workbench accordingly. To make sure the Demand Workbench uses the new decimal field we have just created:
- Navigate to bubble_chart_workbench.list (type in filter navigator and click ENTER)
- Open BOTH records
- Update Z Field dropdown to your new Decimal type field
- Save
4. Last but not least, we need to construct a few Business Rules (either 1 per T-shirt size value, or, you may write a script to update all types in one Business Rule) that will update the decimal field based on updates to the OOB T-Shirt size field.
- Create a new Business Rule on Demand for the first T-Shirt size (small)
- Check 'Insert' and 'Update'
- For When to run, add: [T-Shirt size][changes to][S-Small] *It is important to use 'changes to'. If we substituted 'changes to' for 'is', then the Business Rule would run EVERY time T-Shirt size matches a value. Instead, we only want it to update if T-Shirt size is updated to ANYTHING (on insert of a Demand, or in a later update)
- For Actions, add: [T-Shirt Decimal][To][2]
- Save
*You will now need to create a NEW Business Rule for EACH T-Shirt Size (small, medium, large, xlarge, xxlarge) OR, create a script to update (similar to the above script) when [T-Shirt size][changes]. However, since this is a long Blog post, I will leave that up to you to have fun and test!
That's it! A lot of text, but a simple process.
- 2,657 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.