Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,316
Community Members
 
Community Events
184
Community Groups

Create object with attributes as reference

I'm using insight custom field and insight referenced custom fields in my project. In the project i have added a groovy script to create object in insight as soon as issue is created. Following code :

def cfObjectTypeAttributeBean = objectTypeAttributeFacade.loadObjectTypeAttributeBean(312); 
def cfObjectAttributeBean = newObjectBean.createObjectAttributeBean(cfObjectTypeAttributeBean); t
def cfObjectAttributeValueBean = cfObjectAttributeBean.createObjectAttributeValueBean();
cfObjectAttributeValueBean.setTextShortValue(issue.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObject(10247)).toString());

values = cfObjectAttributeBean.getObjectAttributeValueBeans();
values.add(cfObjectAttributeValueBean); // Add the value to the object attribute
cfObjectAttributeBean.setObjectAttributeValueBeans(values);

objectAttributeBeans.add(cfObjectAttributeBean); // Add to the list of object attributes
}

/* Set all object attributes to the object */
newObjectBean.setObjectAttributeBeans(objectAttributeBeans);

/* Store the object into Insight. The new ObjectBean will be updated with an unique ID */
try {
newObjectBean = objectFacade.storeObjectBean(newObjectBean);
log.warn("newObjectBean: " + newObjectBean);
} catch (Exception vie) {
log.warn("Could not create issue due to validation exception:" + vie.getMessage());
}

 Capture.JPG

The Overall results is as above. However i want the system attribute to be referenced with system ID. If i change the attribute type to object it runs without any error but no output is there.

3 answers

@Abhimanyu Gadroo 

have you had the chance to solve this issue? Thank you in advance

Arianna

@Arianna Fabbriapologies , I forgot to add note here. Its been so long and I guess I found a workaround to this.

Thanks everyone

Do you have a full working example of this? I am trying to accomplish the same thing. 

Hi @Eric Collins

had you been able to do it? :)

Thank you

Arianna

Alexander Sundström
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 04, 2017

Hi, 

If I have understod this correctly, there should be another method you could use:

setReferencedObjectBeanId(Integer referencedObjectBeanId) instead of setTextShortValue

But this has to be the id for the referenced Object to set for that attribute.

Does that make any difference? 
Best Regards
Alexander

Alexander Sundström
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 04, 2017

You can look at the documentation at https://insight-javadoc.riada.se/insight-javadoc-5.0/ for the MutableObjectAttributeValueBean

Hi

I just noticed how show sum function is working. Isnt there any way to filter objects basis on this sum? IN IQL? And then use sum function to update any attribute?

Alexander Sundström
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 12, 2017

Hi,

No, we don't currently have any sum function in the IQL that can be used. For more information on what can be done using IQL take a look at https://documentation.riada.se/pages/viewpage.action?pageId=13573623

Best Regards
Alexander

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events