Hello,
I am trying to change Insight object attributes values via Scriptrunner. Some of them are taken from Jira issue, some are recalculated according to the rules. It's possible to do POST with a huge JSON, but maybe there is a better way to manipulate the InsightObjectAttribute?
The attributes can be type of text, url, user, select, list of values.
I can find the object, even found how to delete the attribute, but unable to figure out how to update it.
E.g.I use this for deletion of attributes:
def deleteInsightObjectAttribute(def object, def attributeKey){ if (object != []){ Class objectFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade"); def objectFacade = ComponentAccessor.getOSGiComponentInstanceOfType(objectFacadeClass); def myAttrValue = objectFacade.loadObjectAttributeBean(object.id, attributeKey).createMutable() value = myAttrValue.getObjectAttributeValueBeans() value.clear() try { objectFacade.deleteObjectAttributeBean(myAttrValue.id); } catch (Exception vie){ log.warn "Could not update object attribute due to validation exception:" + vie.getMessage() } }else{ log.error "Insight object not found." } }
Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.
Get Certified! ✍️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.