One complication I came across while building my Generate Sprints record producer was setting the default value of the Simple SDLC project field to the project that was generating the sprints. After some research, I discovered that you can pass values through the URL. With that in mind, I used a UI action form link to direct users to the record producer while adding the sys_id of the project to the URL.
Once that was established, I used the getParameterValue function from Mark Stanger’s article on parsing URL parameters, and put it in a catalog client script, adjusting some parts to better fit my needs.
This made it so that the project sys_id could be taken from the URL and placed into the Simple SDLC project field on the record producer. Now, when a user opens a project and wants to generate sprints, the project field is already populated with the project they were working on.
Hello,
Nice article… very useful
thanks for sharing the information.
Absolute legend. Thanks for this.
Would have been good though if we could copy the code, rather than having to type everything out from a picture.
For those who feel the same way, here is the Function in the pic:
function getParameterValue(name){
name = name.replace(/[\[]/, “\\\[“).replace(/[\[]/,”\\\]”);
var regexS = “[\\?&]” + name + “=([^&#]*)”;
var regex = new RegExp(regexS);
var results = regex.exec(location);
if (results == null) {
return “”;
} else {
return unescape(results[1]);
}
}
Awesome! Good article indeed.