Create Jira issue Assets automation rule not working
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Problem
Assets Automation rules "Create Jira issue" does not create a Jira issue
By enabling the debug package for Assets Automation , The following appears in the insight_automation.log
1
2
3
4
5
6
7
2022-04-07 16:18:26,220 [http-nio-127.0.0.1-8080-exec-785 url: /rest/insight/1.0/automation/rule/11/events/run; user: psubramaniyan] | AutomationRuleCreateJiraIssueAction, Unexpected error: com.atlassian.jira.util.SimpleErrorCollection@285051f1[errors={customfield_20991=Strategy is required.},errorMessages=[],reasons=[VALIDATION_FAILED]]
com.riadalabs.jira.plugins.insight.common.exception.JiraServiceInsightException: com.atlassian.jira.util.SimpleErrorCollection@285051f1[errors={customfield_20991=Strategy is required.},errorMessages=[],reasons=[VALIDATION_FAILED]]
at com.riadalabs.jira.plugins.insight.services.jira.JIRAServiceImpl.createIssue(JIRAServiceImpl.java:577)
at com.riadalabs.jira.plugins.insight.services.jira.JIRAServiceImpl.createIssue(JIRAServiceImpl.java:530)
at com.riadalabs.jira.plugins.insight.services.automation.action.AutomationRuleCreateJiraIssueAction.doActionSafe(AutomationRuleCreateJiraIssueAction.java:64)
at com.riadalabs.jira.plugins.insight.services.automation.action.AbstractInsightAutomationAction.doAction(AbstractInsightAutomationAction.java:107)
at com.riadalabs.jira.plugins.insight.services.automation.rule.impl.AutomationRuleEngineImpl.executeAction(AutomationRuleEngineImpl.java:675)
Diagnosis
Environment
Jira Service Management Data Center with Assets
Diagnostic Steps
There is an Assetst Automation rule to create a Jira issue with certain criteria is met
The user (either the logged-in user or the user that you select for running scheduled events) has at least the Assets Users role for the schema and permissions to create a Jira issue within the project selected
There is a Jira field or a custom field set to be required
Cause
Assets has a fixed form for creating issues with Automation rules. It does not allow to include other custom fields. If you have a custom field or Jira field set to be required on creation, the automation rule will fail.

Solution
Workaround
You could create a Jira issue using Assets Automation with the required fields as follows:
Use Execute Groovy Script
This action allows a triggered rule to execute a Groovy Script
Use HTTP request
This action allows a triggered rule to make HTTP request and add the mandatory values to the API's payload

Was this helpful?