Default variable not populating to HR Case Description

Rylie Markle
Tera Contributor

I have a variable on my record producer that I want to default to the current logged in user's name. I have it set up to default, but I can't get it to show in the case description after submission. Is there a way to do this?

 

 

RylieMarkle_0-1677524976504.png

 

RylieMarkle_1-1677525074522.png

 

RylieMarkle_2-1677525119709.png

 

RylieMarkle_3-1677525145187.png

 

 

 

1 ACCEPTED SOLUTION

Hi,

Good question and I'm just pointing to the documentation, but after looking at the actual scripts related to this, it appears that there's just 4 that are ignored: opened_for, priority, short_description, description. So other variable names may actually end up in the description of the case.

AllenAndreas_0-1677539318079.png

 

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

6 REPLIES 6

Allen Andreas
Administrator
Administrator

Hi,

If you don't mind, can you clarify if you're saying that other variables are showing up in the case description, but not the one you set the default value for? Or are the variables showing up, to include the field you set the default value for...it's just that the value isn't show up?

There should be a line, something like this in your HR record producer that would create the case from the record producer and during that process, take the variables and put them in the case description per settings: 

new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);

It's unclear as you have some fields censored out (for obvious reasons, but it added some confusion).


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Sorry, I should have been more clear. The entire field isn't showing up in the description. I want it to say "Donator- Employees Name" but there isn't even a line for Donator. 

All of my other variables and their values are showing up fine. 

 

I do have this code in my record producer:

new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);

current.subject_person = producer.subject_person.user;
current.opened_for = producer.opened_for_profile.user;

 

Hi,

Per documentation, since you've named the field "opened_for" which matches an HR case field, the logic is to skip that and not add it to the description: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0993578 

 

You can change the variable name and it should work as you'd like or...you can change the behavior of the process to add it to the description even if it matches an HR case field, but I wouldn't recommend that.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

That makes sense, but why does my subject_person field show up in the description?

I just can't change the name because I have a catalog client script that uses the opened_for user to populate another field on the RP.