Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create issue from Groovy + Insight Object/s field

Gleb Kartashov
Contributor
July 10, 2020

Hi. I'm trying to create issue from groovy w/ mandatory Insight object field:

 

def cat = objectFacade.findObjectBeans(1,query, false, '', 0, 0)[0]
def srv = objectFacade.findObjectBeans(2,query, false, '', 0, 0)[0]
def service = objectFacade.findObjectBeans(3,query, false, '', 0, 0)[0]

...

inputParameters

.addCustomFieldValue("customfield_10218", GetInsightValue(cat.getId(),45))
.addCustomFieldValue("customfield_10225", GetInsightValue(srv.getId(),47))
.addCustomFieldValue("customfield_10226", GetInsightValue(service.getId(),52))

This code results in error:

Errors: {customfield_10225=Could not find insight object/s (object1), customfield_10226=Could not find insight object/s (object2), customfield_10218=Could not find insight object/s (object3)} 

 Also tried putting ObjectBean value type into customfield:

No signature of method: com.atlassian.jira.issue.IssueInputParametersImpl.addCustomFieldValue() is applicable for argument types: (java.lang.String, com.riadalabs.jira.plugins.insight.services.model.MutableObjectBean) values: [customfield_10218, object_here] Possible solutions: addCustomFieldValue(java.lang.String, [Ljava.lang.String;), addCustomFieldValue(java.lang.Long, [Ljava.lang.String;), getCustomFieldValue(java.lang.String), getCustomFieldValue(java.lang.Long) at Script493.run(Script493.groovy:116)

 

Am I doing it right way? Or is it even possible to create issue from groovy with Insight object fields?

Previously I used Jira API for this but now Groovy script is required

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events