Getting access to the Certification Element fields of a Certification Task

ericroberts
Tera Contributor

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

5 REPLIES 5

John Longhitano
Kilo Guru

Hmm Have you checked System Definition > Relationships for a relationship record linking the two tables?

ericroberts
Tera Contributor

Hmmm that helps somewhat.  I do see a Relationship Name: Certification Elements

find_real_file.png

find_real_file.png

...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"

find_real_file.png

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.

find_real_file.png

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'find_real_file.png

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:

find_real_file.png

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

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('---------------------------')
}

ericroberts
Tera Contributor

The 'assigned_to' field is on the cert_task … not the cert_element … i'm not interested in the assigned_to .. I know how to get at that field … what I'm trying to get to is the User info on each cert_element.

 

find_real_file.png