Service Manager

Home 

Using Expressions in Quick Actions

You can create expressions for Quick Actions in Service Manager Business Objects. This allows you to define the action that should be performed for the defined Business Object.

A quick action can employ full expression syntax, surrounded by $(). For example:

$(FieldName)

$([Problem#]Category)

$(2+2)

Example: Using an Expression in a Quick Action

About Using Expressions in Email Fields in Quick Actions

You can include expressions for the To and From fields:

From: Enter an expression to indicate the sender of the email. For example, $(GetGlobal("ListenerEmailAddress")).

To: Enter an expression to indicate the recipient of the email. For example, $(OwnerEmail).

Using an Expression in a Quick Action

From the Quick Action Center, do the following:

1.Do one of the following:

Place your cursor in a field value text box and enter an expression.

Select either the Insert a Field or Insert a Function tab, navigate to an expression, then drag and drop it in to the field value text box.

The items in these tabs vary according to the workspace and logged in user role. These items are Service Manager expressions that you can drag and drop in to a field when configuring a Quick Action. If these tabs are disabled, you can access them by selecting the magnifying glass or yellow pencil button at the end of a field line.

2.Repeat as needed for each field value. You can place multiple expressions in to each field.

3.Click Save.

Example: Accessing a Record from Notification Emails

The following is the syntax for creating a direct link to access a record from a notification email:

<a href="$(Server_URL())/?Scope=ObjectWorkspace&CommandId=Search&ObjectType=Change%23&CommandData=RecId,%3D,0,$([FRS_Approval#.][Change#.]RecId),string,AND|#">

where:

Server_URL is the function name.

Scope=ObjectWorkspace is the access the specified object workspace from the Service Manager web client.

CommandId=Search specifies to search for the specific record in the object workspace.

ObjectType=business_object is the name of the business object in which to search for the record (for example, Change#). Notice in the example URL, the presence of %23, which corresponds in hexadecimal to the "#" character in ASCII.

CommandData=RecId,%3D,0,$([FRS_Approval#.][Change#.]RecId),string,AND|# searches for the record.

For example, if the current record is an FRS_ApprovalVoteTracking record, and you wish to access the grandparent change record via its relationship to FRS_Approval, use the following example expression:

CommandData=RecId,%3D,0,

$([FRS_Approval#.][Change#.]RecId),

string,AND|#

As another example, if the current record is a change record, to access it directly, use the following example expression:

CommandData=RecId,%3D,0,$(RecId),

string,AND|#

The %3D corresponds in hexadecimal to the "=" character in ASCII, and is required as part of the value to the CommandData parameter.

If you are not logged in to Service Manager, the application prompts you to do so upon clicking the link. Access is dictated by your assigned role.

The following is the syntax for creating a link to access My Items tab in the Self Service portal from a notification email:

<a href="$(ServerURL())?Scope=SelfService&role=SelfService&CommandId=OpenMyItem&ItemType=FRS_ApprovalVoteTracking&ItemId=$(RecId)">

where,

ServerURL() is the name of the function.

Scope=SelfService is to access the Self Service portal.

role=SelfService is the Self Service role.

CommandId=OpenMyItem is the fixed user interface action command to open the My Items tab in the Self Service portal.

ItemType=FRS_ApprovalVoteTracking is the approval vote tracking object.

ItemId=$(RecId) is the specific record identified by its associated RecID.

Example: Accessing the My Items List in Self Service Mobile from Notification Emails

The following is the syntax for creating a link to access My Items in the Self Service Mobile portal from a notification email:

<a href="$(Server_URL())/Login.aspx?Scope=SelfServiceMobile&role=SelfServiceMobile&CommandId=OpenMyItem&ItemType=FRS_ApprovalVoteTracking&ItemId=$(ParentRecId)">Open Approval Record in Self Service</a>

where,

ServerURL() is the name of the function.

Scope=SelfServiceMobile is to access the Self Service Mobile portal.

role=SelfServiceMobile is the Self Service Mobile role.

CommandId=OpenMyItem is the fixed user interface action command to open the My Items tab in the Self Service Mobile portal.

ItemType=FRS_ApprovalVoteTracking is the approval vote tracking object.

ItemId=$(ParentRecId) is the specific record identified by its associated RecID.

Example: Accessing a Survey Email Record

Note that you need to add the appropriate expression to the incident or service request send survey business rule.

If you have the following raw URL expression (notice that there are no <a> tags surrounding the expression):

$(GetSurveyURL())&amp;survey_name=$(GetSurveyName("DefaultSurveyName"))&amp;customer_id=$(GetApplicationId())&amp;ot=Incident&amp;oid=$(RecId)&amp;page_index=0

Update it with the following expression:

<a href="$(GetSurveyURL())&amp;survey_name=$(GetSurveyName(&quot;DefaultSurveyName&quot;))&amp;customer_id=$(GetApplicationId())&amp;ot=Incident&amp;oid=$(RecId)&amp;page_index=0">Click here to fill out survey</a>

If you have already modified the send email configuration to the friendly URL, it appears as follows:

<a href="$(GetSurveyURL())&amp;survey_name=$(GetSurveyName("DefaultSurveyName"))&amp;customer_id=$(GetApplicationId())&amp;ot=Incident&amp;oid=$(RecId)&amp;page_index=0">Click here to fill out survey</a>

Update it with the following expression to escape the double-quote characters surrounding DefaultSurveyName, as shown:

<a href="$(GetSurveyURL())&amp;survey_name=$(GetSurveyName(&quot;DefaultSurveyName&quot;))&amp;customer_id=$(GetApplicationId())&amp;ot=Incident&amp;oid=$(RecId)&amp;page_index=0">Click here to fill out survey</a>

If you are not logged in to Service Manager, the application prompts you to do so upon clicking the link. Access is dictated by your assigned role.


Was this article useful?