Follow button in incident form

C_S3
Tera Contributor

Hello All,
We have an requirement, when user opens an incident form and click on FOLLOW button , then the user should be added to the watchlist of that incident. 
But we are not able to find the UI action for that Follow button.
Could someone please let me know how can we achieve this functionalities?

Thank you!

1 ACCEPTED SOLUTION

sushantmalsure
Mega Sage
Mega Sage

Hi @C_S3 

Create a new UI action name 'Follow' on incident table.

Following is screenshot of what I have tried on PDI and found working:

sushantmalsure_0-1690287885951.png

 

Script :

var existing_followers = current.watch_list;
if(existing_followers.indexOf(gs.getUserID())==-1){
current.watch_list = existing_followers+','+gs.getUserID();
current.update();	
gs.addInfoMessage(gs.getUserName()+' has been added to watchlist');	
}
action.setRedirectURL(current);

 

 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

View solution in original post

4 REPLIES 4

sushantmalsure
Mega Sage
Mega Sage

Hi @C_S3 

Create a new UI action name 'Follow' on incident table.

Following is screenshot of what I have tried on PDI and found working:

sushantmalsure_0-1690287885951.png

 

Script :

var existing_followers = current.watch_list;
if(existing_followers.indexOf(gs.getUserID())==-1){
current.watch_list = existing_followers+','+gs.getUserID();
current.update();	
gs.addInfoMessage(gs.getUserName()+' has been added to watchlist');	
}
action.setRedirectURL(current);

 

 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Hello @sushantmalsure ,
Thank you for sharing this. But we need the below functionality as well :
When user click on FOLLOW button and after that if someone is adding comments on work notes or additional comments then he should get notified by an email. 
This functionality is working for the OOB Follow button.

Once user is added to watch list using this follow button then someone updates worknotes or additional comments then OOB notifications sends notification to watch list people, I think you dont have to do anything after you add someone in watchlist (OOB behaviour).

 

If that's not happening, then locate the notifications which are supposed to be sent to watch list people and just add watch list in 'whom to send' section.

 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Hi @sushantmalsure

Regarding same requirement I have it one custom form table name is (u_sob) that follow button is coming from task table. If I am not wrong so First I need to make Inactive that current " follow" button so then only I can write one new UI Action right ?

Could you please help me how can I achieve this to make Inactive for that follow button

Any help will be appreciated. Thanks in Advance. 

Thanks
Aakhiil