How can I get the Insight Custom field object and its attributes using java api.
If you are talking about Jira REST API, then try:
http://<your Jira URL/rest/api/2/issue/<issue #>
If you are talking about getting the Insight data, you will need to use Insight API, look here:
https://documentation.mindville.com/insight/5.0/insight-for-developers/insight-rest-api
Thank you for the response.
Do you have a reference code for insight rest Api using we can get the insight field attributes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try the Find feature of this web service?
https://documentation.mindville.com/insight/5.0/insight-for-developers/insight-rest-api/version-1-0-documentation/object-attributes-rest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
H @Santiago Estel ,
Actually I came across this but in my case, the user is selecting the insight object values while issue transition (popup the issue transition screen and the user will select the value), and based on the selection I need to fetch the object attribute and populate to VM file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will need to use Scriptrunner plugin (or similar) to add some custom code in the post functions of the transtion in case you would like to do something with the insight object user selects in transition screen.
For example:
{code}
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.IssueManager;
import org.apache.log4j.Logger
def log = Logger.getLogger("com.something.great")
log.warn("Workflow function running...")
def customFieldManager = ComponentAccessor.getCustomFieldManager();
/* The object facade class */
Class objectFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade");
/* The reference to the object facade which you can use in your code */
def objectFacade = ComponentAccessor.getOSGiComponentInstanceOfType(objectFacadeClass);
def insightObjCF= customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Some Custom Field'}
def insightObjValue = insightObjCF.getValue(issue);
//Load the insight object
def insightObj=(objectFacade.loadObjectBean(insightObjValue[0].getId()))
def attributes = new ArrayList<>();
attributes = insightObj.getObjectAttributeBeans();
for (def attr : attributes){
if (attr.getObjectTypeAttributeId() == "1234" ){ //id of the attribute
theStuffWeWant = attr.getObjectAttributeValueBeans();
}
log.warn( attr.getObjectAttributeValueBeans().getValue());
}
{code}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.