How to update valid date of knowledge article when user click the republish button

Manasa Allu
Tera Contributor

Hi Team,

 

How to update the valid date automatically of knowledge article when the user clicks the republish button.

 

Example: Valid date of the knowledge article is 2023-08-02

 

The user click's the republish button on 2023-08-17, and the valid date automatically changes to 2023-11-17 (3 months from the date of re-publishing the knowledge article).

 

Regards,

Manasa

1 REPLY 1

Karthiga S
Kilo Sage

Hi @Manasa Allu 

 

You may need to update the OOB UI action to meet the criteria.

But please keep in mind it will not be upgrade-safe.

 

Script to be updated for reference:

var gdate = current.valid_to.getGlideObject(); //considering valid_to is date field on current form
current.valid_to=gdt.addMonths(3); //adding 3 months to date selected
current.update();

Please mark it Correct and Hit Like if you find this helpful!

 

Regards,

Karthiga