Custom Field Defaults
Summary
Custom field values can be set on a per-project and/or per-rule basis in your JEMHCloud profile, where they are called custom field defaults.
To configure your profile, click on the small cog icon next to your JEMHC profile.
Next, navigate to the Project Mappings view. Here, you have two options for setting up the new Custom Field Default: you can either apply it to the default project mapping, which will allow other mappings to inherit this setting, or you can choose to apply it exclusively to one of your non-default project mappings.
To modify the project mapping you have selected, click the small cog icon located next to it. Next, navigate to the Issue tab and select the Edit button, which can be found in the top right corner. Then, scroll down until you reach the Custom field defaults section.
Setting a static value
The simplest way to set a custom field is by passing a static text-format value. Find the desired custom field from the list. Ensure that the drop-down at the end of the row is set to Text, and enter a value to be used for this project mapping/rule.
Once a value has been entered, you can then select when this value should be set (issue creation, issue comment, both). Finally, submit the form to save your changes.
Setting a dynamic value
There are 2 ways to set a dynamically generated value for custom fields:
Why is my custom field not showing in the app?
If you do not see your custom field, it may not be visible on the CREATE issue screen.
When are custom field defaults applied?
Certain configurations will require Custom Fields to be associated with the correct configuration screens. Please refer to https://support.atlassian.com/jira-cloud-administration/docs/manage-issue-screens/ for further information on configuring custom fields in your Issue screens.
Issue Create
JEMHC will attempt to set Custom Field values during Issue create if the custom field is visible on the Issue Create Screen for the associated Project.
Issue update
If a field does not match the above criteria, JEMHC will attempt to update the Issue after the create request has been made. This requires the custom field to be visible on the View/Edit Screen for the associated Project.
What happens if I attempt to set a custom field value to a field not present on create or edit screens?
If the field is not set in the create screen, it attempts to be updated using the edit screen. If the field is not visible on edit, you will receive the following error in the audit report (where X is the field without create/edit association):
Field 'X' cannot be set. It is not on the appropriate screen, or unknown
To resolve this, the field must be added to either the issue create screen or edit screen.
Assets field support using custom field defaults
It is possible to configure values for request types that utilise Assets, using custom field defaults.
Please note, depending on the field type, the options may be pre-defined for you (For example, Hardware ‘Disposal method’).
For now, Asset fields pointing to object IDs require the request value to be hard-coded as per the below format:
Example: Supplying the ‘Hardware’ custom field:
Because the ‘Hardware’ field expects a singular Asset field, only one asset object ID has been supplied.
For any fields that can take multiple values, you can separate the asset objects as shown below:
[{"id": "ec001929-a9ba-46e9-973e-1a4f8824ecde:1"},{"id": "ec001929-a9ba-46e9-973e-1a4f8824ecde:2"}]
Retrieving Asset Workspace and Object ID(s)
The Workspace ID can be found by calling the endpoint for your site, you can locate the workspace ID to set as a default:
https://<SITE.ATLASSIAN.NET>/rest/servicedeskapi/assets/workspaceMore information: https://community.atlassian.com/forums/discussion/2529335/jira-assets-workspaceid.
The Asset Object ID can be found from within your Assets configuration.
Navigate to your Assets schema, select the Object you want
In the Web URL, there will be an
objectId=<ID>. This is your Object ID