Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

Power Suite Apps for Jira
Results will update as you type.
  • Power Scripts for Jira
  • Power Actions for Jira
  • Power Custom Fields
  • Power Database Fields
  • Power Dashboard Reports and Gadgets
  • SIL Connector modules
  • Simple Issue Language
  • Tutorials and recipes
    • Recipes by Add-on
      • Power Actions Recipes
      • Power Scripts Recipes
        • Add internal comments to Jira Service Desk requests
        • Add a group as participants in Jira Service Desk
        • Add participants automatically to new Jira Service Desk requests
        • Adjust an estimate according to assignee
        • Assign issues to the previous assignee
        • Assign issues automatically based on workload
        • Assign an issue while maintaining the user load
        • Assign users based on a decision table using SIL™
        • Create a sub-task automatically based on custom field selection
        • Create story subtasks and close them when story is closed
        • Calculate the due date based on custom field values
        • Copy data from the parent issue
        • Copy the reporter and watchers on duplicate issues
        • Copy a custom field value to another field when changed
        • Copy watchers to sub-tasks
        • Create a Select All option in a dropdown list
        • Create a custom cascading dropdown field
        • Use validators based on date range
        • Set default values for system fields on the Create screen
        • Disable inline edits
        • Filter based on multiple criteria by using a non-Boolean JQL function
        • Hide the Create issue button until an attachment is added
        • Hide specific priorities for certain projects
        • Hide specific issue types for certain users
        • Compare two fields with custom JQL
        • Get the time spent by an issue in certain statuses
        • Hide fields for users with no developer role
        • Hide the comment field during a transition
        • Hide time-tracking information
        • Insight REST API
        • Perform searches with LDAP
        • Limit the number of characters in a text-entry field
        • Limit the assignee to a specific group
        • Limit the number of user votes per month
        • Map story points to hours and automatically log work on completion
        • Automatically move unresolved issues to next sprint and update story points
        • Automatically update the custom field ID and/or name in filters
        • Create custom JQL functions for nested issue reporting
        • Prepopulate fields during a transition
        • Replicate the native Jira email handler
        • Require users to log work before transitioning an issue
        • Ensure that issues have attachments
        • Require fields in subtasks
        • Use a workflow validator based on logged hours
        • Require the fix versions when resolving an issue
        • Reset a field
        • Prevent a select list from displaying certain values
        • Limit the issue type selection to specific users
        • Prevent a select list from displaying certain options
        • Limit sub-tasks based on issue type
        • Limit transitions based on the status of dependent issues
        • Limit possible resolutions based on issue type
        • Display all issues linked to a given issue and link type
        • Search for all issues associated with multiple epics
        • See and search on the last person to modify an issue
        • Set approver in Jira Service Desk
        • Display a message custom field based on a drop-down list value
        • Track completion progress
        • Transition past due issues
        • Update Portfolio Parent Link using REST API
        • Initialize field values for a transition screen
        • Create a validator for a component lead
        • Display all issues where work logged exceeded estimate
        • Filter by project and issue type
        • Synchronize comments between projects
        • Hide multiple fields based on custom field value
        • Automatically archive old projects
        • Copying rich formatted description or Atlassian Document Format (ADF) example
      • Power Custom Fields Recipes
      • Power Database Custom Fields Recipes
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    Insight REST API
    Updated Jul 14

    Insight REST API

    Deprecation notice

    The Insight REST API library is deprecated and no longer recommended for new implementations.

    While this code remains functional, we strongly recommend using the SIL Insight Connector for all new Insight (Jira Assets) integrations. The SIL Insight Connector provides:

    • Native SIL functions for Insight operations (no manual REST API calls required).

    • Simplified integration with built-in authentication and error handling.

    • Active support and development with regular updates.

    • Better performance and reliability.

    Recommended approach:

    • For new projects, use the SIL Insight Connector available on the Atlassian Marketplace.

    • For existing implementations, this legacy library will continue to work, but consider migrating to the SIL Insight Connector during your next maintenance cycle.

    Insight Inclusion Script

    The following code is a library of functions that works with the Insight (Jira Assets) REST API using manual HTTP requests.

    struct objectType { number id; string name; number type; string created; string updated; number parentObjectTypeId; number objectSchemeid; boolean inherited; } struct referenceObj { number id; string label; string objectKey; objectType objectType; string created; string updated; } struct attributeValue { string value; string displayValue; referenceObj referencedObject; } struct attribute { number id; number objectTypeAttributeId; attributeValue[] objectAttributeValues; number objectId; number position; } struct objectEntry { number id; string label; string name; string objectKey; objectType objectType; attribute[] attributes; } struct defaultType { number id; string name; } struct objectTypeAttribute { number id; string name; string label; number type; defaultType defaultType; boolean editable; boolean system; boolean sortable; boolean summable; number minimumCardinality; number maximumCardinality; boolean removable; boolean hidden; boolean includeChildObjectTypes; boolean uniqueAttribute; string options; number position; } struct insightQueryResult { objectEntry[] objectEntries; objectTypeAttribute[] objectTypeAttributes; } /* * Retrieves the Insight object key of a Jira issue custom field. * @param fieldValue (string) The value of a custom field. * @return (string) The object key of the insight object. Example: ABC-123 */ function getCustomFieldInsightKey(string fieldValue) { return matchText(fieldValue, "(?<=\\().+?(?=\\))"); } /** * Runs a query against a specified insight schema to gather object(s) using the * IQL query language. See https://bit.ly/2OI5QVt for more info about IQL. * @param schemeId (string) The id of the insight schema to query. Example: "2" * @param iqlQuery (string) The IQL query string to return the desired objects. Example: 'Key in ("ABC-1", "ABC-2")' * @param username (string) Username of user of Insight schema. * @param password (string) Password that corresponds to the 'username' parameter. * @return insightQueryResult representation of query result. */ function getInsightObject(string schemeId, string iqlQuery, string username, string password) { string insightURL = getJIRABaseUrl()+"/rest/insight/1.0/iql/objects"; HttpRequest request; request.headers += httpBasicAuthHeader(username, password); request.parameters += httpCreateParameter("objectSchemaId", schemeId); request.parameters += httpCreateParameter("iql", iqlQuery); insightQueryResult result = httpGet(insightURL, request); return result; } /* * Retrieves the value of an attribute based on the provided attribute name. * @param obj (insightQueryResult) Insight object to retrieve value from * @param attributeName (string) The name of the attribute to retrieve. * @return string representation of attribute value if found. Otherwise, null if attribute is not found. */ function getInsightObjectAttribute(insightQueryResult obj, string attributeName) { string[] result; if(isNotNull(obj)) { // Determines if an attribute with propvided 'attributeName' exists. // If true, saves the corresponding id of attritute to search for value. number attributeId = 0; for(objectTypeAttribute t in obj.objectTypeAttributes) { if(t.name == attributeName) { attributeId = t.id; break; } } // If attribute exists, finds the corresponding value of the attribute. if(attributeId != 0) { for(objectEntry o in obj.objectEntries) { // Possible multiple objects for(attribute a in o.attributes) { // Possible multiple attribute values if(a.objectTypeAttributeId == attributeId) { for(attributeValue v in a.objectAttributeValues) { result += v.displayValue; break; } } } } } } return result; }

    Need support? Create a request with our support team.

    Copyright © 2005 - 2025 Appfire | All rights reserved.

    {"serverDuration": 15, "requestCorrelationId": "a5c38e19510744cbbab2f97a15c6e50d"}