The CreatorCon Call for Content is officially open! Get started here.

Hr case short recsription

chandan31
Tera Contributor

Hi All,

 

 

Can you tell me  in which script short description of hr case is populating  "HR service name - employee name (employee ID)because one of the service which is designed recently i want static short description like  "abcd" but i am unable to find the script .

 

Can you suggest.

 

  

1 ACCEPTED SOLUTION

You could do like this

_setShortDescription: function(serviceName, username) {
gs.info("check ServiceName"+serviceName);// check the value of your servicename in logs
        if(serviceName == "Your Service Name") // pass your HR servicename you get in log
        {
            this._case.short_description = gs.getMessage("{0} case for {1}", [ "YOur short desc", username ]);
        }
        else
        {
                this._case.short_description = gs.getMessage("{0} case for {1}", [ serviceName, username ]);
        }
   
    },
Regards
Harish

View solution in original post

8 REPLIES 8

Harish KM
Kilo Patron
Kilo Patron

Hi @chandan31 The script include is named hr_ServicesUtil, and it's calling the function: createCaseFromProducer and

In hr_CaseUtils script include you need to check this line

this._case.short_description = gs.getMessage("{0} case for {1}", [ serviceName, username ]);
Regards
Harish

Ankur Bawiskar
Tera Patron
Tera Patron

@chandan31 

it comes from script include shared by Harish

Please update it and let us know if it works

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Sorry from my side in my script include "this._case.short_description = gs.getMessage("{0} case for {1}", [ serviceName, username ]); is not present .

 

createCaseFromProducerByService : function(producer, service, rpId) {
       
        // Convert the producer to a question list object
        var questions = this._getProducerQuestions(producer, rpId);

        // Set the proper HR Case fields
        this.updateCase(service, questions, 'self_service');
       
        // Set the redirect for the producer back to Case list
        producer.redirect = 'sn_hr_core_case_list.do?sysparm_query=active%3Dtrue^opened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORDERBYDESCnumber&sysparm_titleless=true';
    },
 
 
Can you tell me the line number , it is avaible "this._case.short_description = gs.getMessage("{0} case for {1}", [ serviceName, username ]);"

You need to check this script include "hr_CaseUtils" for short desc

Regards
Harish