Add Affected Services to a request form in Jira Service Management Cloud
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Learn how to allow customers to set the 'Affected Services' field, pulling referenced services from an attribute on an Assets object.
Customers can't interact with the Affected Services field from the portal request form — even if you add it, unlicensed customer accounts can't see or set it. This article's workaround lets customers set it indirectly via an Assets object field. The direct-portal feature is tracked at JSDCLOUD-9779.
Solution
Allow customers to indirectly set Affected Services
Say you have an object type (for example, Computer) with an attribute named Services that references your Services. Each Computer has Services referenced in it.
This solution allows you to configure an Assets custom field (which can be used on the portal) based on the Computer object, and have an automation update the Affected Services field based on the Computer selected by the customer.
Add a Services attribute (referencing the Services schema) to the object type customers will select from.
Create an Assets object custom field that lists those objects and add it to the JSM screen and request type.
Create an automation: Trigger: Work item created.
Action: Lookup objects on the Services schema with this AQL:
object HAVING inR(objectType = "<Object Type Name>" AND Key in ({{issue.customfield_XXXX}}))Replace <Object Type Name> with your object type name and issue.customfield_XXXX with the Assets custom field you created.
Action: Edit work item > More options > Additional fields, with this JSON:
{ "fields": { "Affected services": [ {{#lookupObjects}} {"id": "{{Service ID}}"}{{^last}},{{/}} {{/}} ] } }Replace
<Object Type Name>andissue.customfield_XXXXwith your object type and the Assets custom field.Save and publish the automation rule.
Raise a portal request by selecting an object in the Assets field, then confirm that the rule populates Affected Services with the referenced services (check the automation audit log).
Related articles
Was this helpful?