Getting access to the Certification Element fields of a Certification Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 03:29 PM
I have a Certification Schedule that has Display Fields = User adn Certification Fields = Role.
I have 3 users that match the Cert. Filter in the Cert. Schedule. I have a Notification Email with generic out of the box verbiage that the assigned to user has a Data Cert task to go approve/reject using the Data Certification plugin.
The Certification Task (ie: TSK0010033) that is created shows the User names at the bottom of the TSK record...as expected.
Is there a way to collect those user names so I can add them to the email. I cannot figure out where the relationship is from the original cert_task record...I have hte sysID of the Cert_Task record ... but I can't figure out where to go to drill down into those Display Fields.
My ultimate goal is to update the email template to add hte list of users who are a part of this cert task ... so the manager sees right in the email who the employees are who need certified.
A stretch goal would be to then create an inbound email action to automate approving all of these cert elements. I know in the real world only a subset of the users might be approved ..and some rejected .. but for us...99% of the time it's just a rubber stamp ... approve all.
Thanks for any help.
ER
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 03:48 PM
Hmm Have you checked System Definition > Relationships for a relationship record linking the two tables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 06:30 PM
Hmmm that helps somewhat. I do see a Relationship Name: Certification Elements
...but it seems to be from Global ... so not really sure what that means.
When I open up one of the records in the cert_task table and look at the Layout I see a 'section' under Activities that renders the related cert_elements info ... in the Layout it shows as "Certification Task Elements"
As shown below that 'section' not only has the cert_elements ... but also has some language, link, input box, action buttons, etc ... over the cert_elements.
I don't know how to find out what renders that whole section ... I'd like to take a peek inside those buttons to see how they work also.
What's really got me puzzled is that I can get a hook into the Cert. Task (ie: cert_task table where 'number=TSK0010029') -- and I can see the cert_element table where cert tasks are assigned/associated with the TSK record. ie: cert_element table where 'cert_task=TSK0010029'
Those records are the AUDRxxx records.
If I run something like this:
var target = new GlideRecord('cert_element');
target.addQuery('cert_task.number', 'TSK0010029');
target.query(); // Issue the query to the database to get relevant records
while (target.next()) {
gs.info('Number: ' + target.number)
gs.info('State: ' + target.state)
gs.info('User Name: ????????')
gs.info('---------------------------')
}
I get this:
I can get to the cert_element records based on the cert_task ... and I can get some field values (number, state, element, etc etc) ... but there is no option to get to the User Name.
Thx,
ER

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2019 09:51 AM
If you want the user display name use '.getDisplayValue()' if you want the users sys_id just leave it at .assigned_to
var target = new GlideRecord('cert_element');
target.addQuery('cert_task.number', 'TSK0010029');
target.query(); // Issue the query to the database to get relevant records
while (target.next()) {
gs.info('Number: ' + target.number)
gs.info('State: ' + target.state)
gs.info('User Name: ' +target.cert_task.assigned_to.getDisplayValue())
gs.info('---------------------------')
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2019 10:05 AM