If you create an SLA Definition, contract_sla, for a Catalog Task, sc_task, and you want the SLA start to be dependent on a variable in a catalog variable, the SLA Definitions behave erratically because an invalid query is stored into the SLA Definition.
The principal behavior is the SLA will always attach; in other words, it appears to ignore the variable portion of the condition.
Steps to Reproduce
The following steps are for testing in Helsinki Patch 7.
- The variables being checked in the SLA Condition must be on the sc_task record, you cannot dot-walk to query the variables on the requested item record.
- Tested with the Standard Laptop catalog item.
- Check out the Service Catalog Item Request workflow, change the Catalog Task, Stage: Order Fulfillment (4 Days) activity to add the Standard Laptop variablesm so they are populated into the sc_task record; publish the revised workflow.
- Now, when following the STRs, the variables from the Service Catalog input are passed into both the sc_req_item and the sc_task record.
- Navigate to an sc_task record and add the Task SLA > Task related list to the layout.
Steps to Reproduce:
- Apply the attached unload of SLA definitions; two that are constructed using the Condition builder as expected, which is bad and two that are constructed by using the Condition builder to try to access the variables on the sc_req_item, which is good.
- Navigate to the Service Catalog, and create a new request for a Standard Laptop. Include the word test in Additional software requirements.
- Create a second new request for a Standard Laptop; include the word check instead of the word test in Additional software requirements.
- Navigate to the first new request, then to the Approvals tab, and approve it.
- Navigate to the Requested Items related list on the request, select the request item, navigate to the request item approvals tab, and approve the request item; the new sc_task record is generated.
- Navigate to the Catalog Tasks related list on the request item, select the new catalog task, and take a look at the Task SLAs; three are attached, both bad SLAs, and the expected good SLA.
- Repeat steps 4 though 6 for the second new request; note that the second catalog task has three attached Task SLAs, both bad SLAs, and the second expected good SLA.
To get this to work as expected
- Dot-walked queries to the variables on another record are not supported. For example, to reference the variables on the sc_req_item record from the sc_task SLA definition is not supported.
- Ensure that when the sc_task record is created, the desired variables are populated into the sc_task record.
- This can be done through the workflow activity, if using the base system Catalog Task activity to create the new sc_task record from a workflow.
- In the SLA Definition, in the condition builder, use Show Related Fields to see the Variables field.
- If using the Variables field from sc_task, it generates an invalid query.
- Navigate to Request Item > Requested Item fields, and then select the Variables field for the sc_req_item, the correct query is generated.
- This is a strange result, but the system does not create the expected dot-walked portion of the query
- The generated portion of the query is the correct form for querying the variable as long as it exists for the record, whether it is sc_req_item or sc_task.
Related Problem: PRB726752