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

Allow a user to add others to the watchlist from the portal

Moedeb
Tera Guru

I would like to be able to have a user when making a catalog request via the portal to also have an option to add others to the watchlist for that request item.

 

EG: EA requesting on behalf of an Executive, wants to add their own name to the watch list so they can keep an eye on the request on behalf of the executive, or even just the requester going on leave and wants someone else to be able to see the updates.

 

I thought it would be as easy as mapping the question to the watchlist field and onsubmit adding those in the field, however this doesn't appear to be as simple as I thought.

Any help would be very much appreciated.

 

1 ACCEPTED SOLUTION

Moedeb
Tera Guru

I have managed to figure this out based on a few people's posts, so feel it best I share my overall solution.

Firstly, thank you to Vishal as your first link was helpful - First Link

I also found the script I needed here and wanted to give credit to Pradeep Sharma for their post

 

Firstly what I did was created a Variable Set for the watch list, so I could easily add it to any request or record producer that I wanted the ability to have a user add others to the watch list.

In the variable set I created a variable and called it 'add_to_watchlist' - this was set as a List Collector field.

 

I then created a Business Rule as follows:

Name: (really whatever you like)

Table: Incident [incident]  *If you are doing this for a request item the table would need to be Requested Item [sc_req_item]

Active: Selected

Advanced: Selected

When to run Tab

When: before

Order: 100 (really whatever suits you)

Insert: Selected

Update: Selected

Delete: unselected

Query: unselected

Filter Conditions and Role Conditions - leave as default

 

Actions Tab

Leave as is

 

Advanced Tab

Condition: Blank

Script:

(function executeRule(current, previous /*null when async*/) {

if(current.variables.add_to_watchlist)
{
current.watch_list = current.variables.add_to_watchlist;
}

})(current, previous);

 

Then save and add the variable set to the record producer (catalog request if doing a request item)

View solution in original post

6 REPLIES 6

@Nathaniel Alves thanks for this comment. There can certainly be an issue where the buisiness rule overwrites anyone going into the ticket and adding or removing watchlist users the traditional way, however there is another way that it can be done directly from the ticket.

What we have done is add the viarible editor to the ticket form, that way the watchlist field used on the self service portal is visable in the ticket view as well. Therefore what you need to do is edit who is on the watchlist from there rather than the 'normal' spot. EG:

find_real_file.png

 

Hope this helps.

 

If you have found this solution helpful, please think about marking it as such 🙂

Thank you @Moedeb! One more question since you are so knowledgeable. I need to be able to add internal AND external folks to the watch list. So to make this work for external, I did a text field and it works great.

So for internal and external would I need to create a variable set with a list collector variable referenced to sys_user and then a variable with single line text for an external email?

Nate