- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 02:38 PM
Hi,
I have been trying to auto populate description value from a Change Request to Change Task. Not having any luck Been trying to use
Business Rules.
At present, we have a standard change template that has change tasks automatically populated through Execution Plans.
I would like all the change tasks to have the description field to be the same as the parent Change Request's description upon creation of the tasks.
I've read different posts here but most are scripts for workflow. But I'm not using a workflow. Is there a Business Rule script/set up I could use to do so?
Your help will be greatly appreciated. Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 03:30 PM
Hi Peggy,
Your script seems to be fine.
Are you sure, the 'Description' value from Change request does not copy over AFTER you insert the Change-Task record ?
I've just tried the below in my personal instance and working as expected:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 03:55 PM
Thanks Samiul. That's brilliant! I didn't have to use Script. Followed your steps.
Thanks, its working now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 08:21 PM
Now that I have this working, the user wanted something more now.
Are we also able to add in the change task description a text and then some values (not all values) of description from the parent change request?
A way of example would be, the change task description to be "Notification of <insert part of text from description of change request>"
Is this possible abhinay samiul ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 08:54 PM
Hi Peggy,
The following will give you some idea to accomplish your requirement:
(function executeRule(current, previous /*null when async*/) {
var change_description = current.change_request.description;
var part_of_description = change_description.slice(3); //http://www.w3schools.com/jsref/jsref_slice_string.asp
var modified_description = "Notification of "+part_of_description;
current.description = modified_description;
})(current, previous);