Automation action returning Internal Server Error when editing Assets custom field
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Using the Create issue Automation action and trying to set an Assets custom field during the issue creation an Internal Server Error is returned if the Assets custom field has a project context configuration that does not include the source project that triggered the automation rule.
Diagnosis
For this scenario there are two projects:
- EXAMPLE
- TEST
On the TEST project there is an Assets custom field called Approver Services and this field's contexts is restricted to only the TEST project as shown in the screenshot below:
On the EXAMPLE project, an automation rule using the Create issue action creates a ticket in the TEST project. During the issue creation process the action tries to set the Approver Services assets custom field, which fails to be set due to an internal server error. In this example, we are using another Assets custom field on the trigger issue as part of the AQL however this issue can be demonstrated with any valid AQL to edit the field:
As can be seen in the audit log entry, the issue created, however editing the Assets custom field has failed with the error An error occurred while requesting remote information Internal server error:
Cause
The issue is caused by the following bug:
JSDCLOUD-13097 - Getting issue details... STATUS
The above behavior has been reported as a bug since other Jira custom fields that were tested worked as expected even with the project restriction in the field context.
Solution
Workaround one
One workaround would be to add the source project that an automation rule is using when interacting with an Assets custom field to the field context. Instructions on editing a custom field's context can be found at the following support article:
Workaround two
Part of the problem in this case is that the automation rule will use the trigger issue in its context during the issue creation process, which is then impacted by the mentioned bug.
Depending on your automation rule, it may be possible to break it up in order to remove the Assets custom field from the Create issue action and edit the newly created issue as an additional action via the Edit issue action. This can be achieved using the Related issues branch with the Most recently created issue selection, which will act on the ticket that was created in the destination project, in this case TEST where the custom field context is configured to work. An example configuration can be seen below: