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.
Currently, customers can't interact with the Affected Services field via request form in the portal. You can add the field to the request form, but users who are not licensed Jira users won't be able to see or interact with it.
There is a feature request for this: JSDCLOUD-9779 - Allow the use of Affected Services field on the portal for customer accounts.
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 applies so that you can 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.
Solution
Add a 'Services' attribute (that references the Services schema) to the schema and object type where you would like users to select objects.
Create a custom Assets object field that lists all objects from the above object type and add it to the JSM screen.
Add the Assets field to the relevant request type.
Create automation:
Trigger: Work item created.
Action: Lookup objects. Select the Services schema and use the following query to look up all services that have a reference to the selected object on the Assets custom field:
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. Expand 'More options' and in 'Additional fields', enter the following JSON to update the 'Affected services' field:
{ "fields": { "Affected services": [ {{#lookupObjects}} {"id": "{{Service ID}}"}{{^last}},{{/}} {{/}} ] } }
Save and publish the automation rule.
Related articles
Was this helpful?