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

How to customize service portal activity stream Widget "Ticket Conversations"

Kevin McGartlan
Tera Contributor

Hello,

I have a requirement to enable the Time/Date stamp underneath the activity stream posts which currently show "2h ago" instead of a YYYY-MM-DD format which we want to display too. I have cloned the Form widget and the Ticket Conversation widget so I can customize the two to meet this requirement. I edited the Form widget to generate the copy of ticket conversations widget like so: 

fm.widgetInstance = $sp.getWidget('widget-copy-of-ticket-conversations',
                      {table: data.table,
                       sys_id: data.sys_id,
                        includeExtended: true,
                        title: "${Activity}",
                        use_dynamic_placeholder: true,
                        btnLabel: "${Post}"});

However, now when I open an incident form, I'm presented with the following screen which doesn't show any ticket conversation widget:

find_real_file.png

Does anyone have any idea how to get the cloned ticket conversation widget to display? I tried to make sure that the correct angular dependencies and templates are in the related list for the Copy of Form widget I had created. I also replaced the OOTB Form widget on the Form page to the Copy of Form widget I cloned to ensure it's opening the correct widget. 

I'm thinking that it may be the else condition: 

} else
        fm.widgetInstance = $sp.getWidget(fm.widget, data);

I'm not sure how to correctly change the .getWidget call to call the correct widget as I'm not sure how the "fm" formatter will handle it.

Also, just to complicate further, I see that the OOTB Form widget has 3 angular-ng-templates. I cannot find a way to do an "insert-and-stay" for these 3 angular-ng-templates since the id's are matching. What is the process of creating new angular templates so I can correctly 100% match my newly created Form widget with the OOTB widget? 

Thank you for your help in advance!

1 ACCEPTED SOLUTION

Can you confirm, you have added work notes and additional comments to your form using form layout. Without which, form-model mayn't be able to identify wether to add the activity widget.


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

8 REPLIES 8

SanjivMeher
Kilo Patron
Kilo Patron

Did you add the cloned widget to your page? You can directly add that widget to the page and it should work.

But If you want to embed in the form widget, you will have to add it in the HTML using <sp-widget> tags.For ex, below is an example of Approval Record widget.

 

find_real_file.png


Please mark this response as correct or helpful if it assisted you with your question.

I believe I had added the cloned widget to the page, but I may not be looking in the right place:

find_real_file.png

In the "Copy of Form" widget, I had the following code to call the Cloned Ticket Conversations widget:

find_real_file.png

You also need to call the widget you initiated in Server Script using <sp-widget> in html as show below.

 

<sp-widget widget="fm.widgetInstance" />>

 

find_real_file.png


Please mark this response as correct or helpful if it assisted you with your question.

I'm a bit confused on this still. I would have thought just making a clone from the Form widget would have done the trick after I added the cloned widget to the page. There isn't any html code that adds in the ticket conversation widget before this in the OOTB Form widget, so is that really necessary?