{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":883,"path":"api-reference/server-api-reference/ProcessMiningIntAPIScoped.md","title":"ProcessMiningIntegrationAPI - Scoped","bundle":null,"doc_type":null,"release":"australia","body":"\n# ProcessMiningIntegrationAPI- Scoped\n\nThe ProcessMiningIntegrationAPI script include provides methods to manage process mining projects and retrieve findings and breakdowns.\n\nThis script include requires the Process Mining plugin \\(sn\\_po\\). For more information, see [Process Mining](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/process-mining.md).\n\nThe calling user must have the sn\\_process\\_mining\\_analyst or sn\\_process\\_mining\\_power\\_user role.\n\nThe following system properties can be used to manage API functionality.\n\n-   **__promin.limit.api.project\\_creation__**\n\n    Limits the number of projects that can be created daily using APIs.\n\n    Default: 25.\n\n-   **__promin.limit.api.max\\_daily\\_minings__**\n\n    Limits the number of minings that can be scheduled daily using APIs.\n\n    Default: 25.\n\n-   **__promin.limit.api.max\\_daily\\_minings\\_per\\_project__**\n\n    Limits the number of minings that can be scheduled daily per project using APIs.\n\n    Default: 1.\n\n-   **__promin.api.allow\\_no\\_role\\_mining__**\n\n    Allows projects to be mined by users without the sn\\_process\\_mining\\_analyst role.\n\n    Default: False.\n\n-   **__promin.api.auto\\_share\\_project\\_with\\_creator__**\n\n    Automatically shares the project with the creator of the project.\n\n    Default: False.\n\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## ProcessMiningIntegrationAPI - createProject\\(String table, Array activities, Array breakdowns, String encodedQuery, String templateType, Object permissions, Boolean autoRetire\\)\n\nCreates a process mining project.\n\nA project acts as a blueprint for Process Mining operations. It selects the process that the mining is done on and which attributes of the process are considered while mining.\n\n<table id=\"table_xs3_lqs_kdc\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ntable\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table containing the data to analyze.\n\n</td></tr><tr><td>\n\nactivities\n\n</td><td>\n\nArray\n\n</td><td>\n\nActivity definitions for the project. An activity definition is an attribute of the process to consider while mining, such as state or assignment group. It must be a column from the table specified in the **table** parameter. At least one activity definition is required to mine a project. For more information about activity definitions, see [Set activity definitions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/set-activity-def.md).\n\n**Note:** Activity definitions are also included in the project template specified in the **templateType** parameter. Use the **activities** parameter to specify any additional activities not included in the template.\n\n```\n[\"<column_name>\"]\n```\n\n</td></tr><tr><td>\n\nbreakdowns\n\n</td><td>\n\nArray\n\n</td><td>\n\nBreakdown definitions for the project.A breakdown definition allows you to filter records and analyze a process map by categories, such as priority or business category. It must be a column from the table specified in the **table** parameter. Breakdown definitions aren't required to mine a project. For more information about breakdown definitions, see [Set breakdown definitions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/breakdown.md).\n\n**Note:** Breakdown definitions are also included in the project template specified in the **templateType** parameter. Use the **breakdowns** parameter to specify any additional breakdowns not included in the template.\n\n```\n[\"<column_name>\"]\n```\n\n</td></tr><tr><td>\n\nencodedQuery\n\n</td><td>\n\nString\n\n</td><td>\n\nEncoded query to select the data to analyze. This allows you to limit the data that is analyzed, such as by selecting data only from a specified time period.To include all data in the table, you can pass an empty string.\n\n</td></tr><tr><td>\n\ntemplateType\n\n</td><td>\n\nString\n\n</td><td>\n\nType of template to use for the project.Valid values:\n\n-   Default\n-   Digital Portfolio Management\n-   Vendor Management\n-   WFO\n\nFor a project that is not part of Workforce Optimization \\(WFO\\), Vendor Management, or Digital Portfolio Management, choose Default. For example, to create a Performance Analytics project, select Default.\n\n</td></tr><tr><td>\n\npermissions\n\n</td><td>\n\nObject\n\n</td><td>\n\nMap of groups, roles, and users to share the project with, where the key is a sys\\_id and the value specifies the type \\(group, role, or user\\).All users who the project is shared with can view the analyzed model and view project configurations. Only users with the sn\\_process\\_optimization\\_analyst or sn\\_process\\_optimization\\_power\\_user can mine the project.\n\n```\n{\n   \"<user_sys_id>\":\"user\",\n   \"<role_sys_id>\":\"role\",\n   \"<group_sys_id>\":\"group\"\n}\n```\n\n</td></tr><tr><td>\n\nautoRetire\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nOptional. Flag that indicates whether to automatically retire the project.\n\n Valid values:\n\n-   true: The project is automatically retired seven days after creation.\n-   false: The project isn't automatically retired.\n\n Default: False\n\n</td></tr></tbody>\n</table><table id=\"id_x1l_krq_c2c\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nObject\n\n</td><td>\n\nObject containing information about the project.```\n{\n   \"entity\": {Object},\n   \"findingDefinitionKPIMap\": {Object},\n   \"id\": \"String\",\n   \"lastMined\": String\",\n   \"miningState\": \"String\",\n   \"name\": \"String\",\n   \"permissions\": [Array],\n   \"retiredDate\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity\n\n</td><td>\n\nObject containing information about the data analyzed in the project.Data type: Object\n\n```\n{\n   \"activityDefinitions\": [Array],\n   \"breakdownDefinitions\": [Array],\n   \"condition\": \"String,\"\n   \"table\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.activityDefinitions\n\n</td><td>\n\nActivity definitions for the project.Data type: Array\n\n```\n[\n   {\n      \"activityOfInterest\":Boolean,\n      \"field\":\"String\",\n      \"type\":\"String\"      \n   }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.activityDefinitions.activityOfInterest\n\n</td><td>\n\nFlag that indicates whether field changes appear in the analyst workbench.\n\n Valid values:\n\n-   true: Field changes appear in the analyst workbench.\n-   false: Field changes don’t appear in the analyst workbench, but can still be used in contextual conditions in transitions or findings.\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.activityDefinitions.field\n\n</td><td>\n\nField containing the data to analyze. The field must be from the table specified in the **table** parameter.\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.activityDefinitions.type\n\n</td><td>\n\nThe type of values to mine.Valid values:\n\n-   Field Values \\(Default\\): This is the default selection. This option is available whenever you create an activity definition.\n-   Date Time: Uses date time value from the actual record rather than the audit history and is displayed as a grouped node on the process map.\n-   Compound: One node or process graph representing change in the multiple field value from the actual record rather than the audit history.\n-   Child Attached: This option is available when you have selected two tables for table configuration and have set a child-parent relationship. This option is available only for the parent table configuration. In the visualization, you will see when the child was attached in the process.\n-   Parent Attached: This option creates a node on the child process representing when a parent record was attached to a child.\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.breakdownDefinitions\n\n</td><td>\n\nBreakdown definitions for the project.Data type: Array\n\n```\n[\n {\n   \"field\":\"String\",\n   \"fieldLabel\":\"String\"\n }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.breakdownDefinitions.field\n\n</td><td>\n\nName of the field used in the breakdown.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.breakdownDefinitions.fieldLabel\n\n</td><td>\n\nLabel of the field used in the breakdown.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.condition\n\n</td><td>\n\nEncoded query to select the data to analyze.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.table\n\n</td><td>\n\nName of the table containing the data to analyze.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.findingDefinitionKPIMap\n\n</td><td>\n\nMap of improvement opportunities and key performance indicators \\(KPIs\\), where the map key is an improvement opportunity sys\\_id and the value is an array of sys\\_ids of the KPIs impacted by the improvement opportunity.Improvement opportunities are located in the Finding Definition \\[promin\\_finding\\_def\\] and Automated Finding Definition \\[promin\\_automated\\_finding\\] tables. KPIs are located in the Indicator \\[pa\\_indicators\\] table.\n\nFor more information about improvement opportunities and KPIs, see [Setting improvement opportunities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/working-with-imp-opp.md) and [Viewing business insights](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/view-business-findings.md).\n\nData type: Object\n\n```\n{\n   \"<finding_def_sys_id\":[\n      \"<kpi_sys_id>\"\n   ]\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.id\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.lastMined\n\n</td><td>\n\nDate the project was last mined.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.miningState\n\n</td><td>\n\nMining state for the project.For descriptions of mining states, see [Mining states](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/generate-process-map.md).\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.name\n\n</td><td>\n\nName of the project.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.permissions\n\n</td><td>\n\nGroup, role, and user permissions for the project.Data type: Object\n\n```\n[\n   {\n      \"type\":\"String\",\n      \"value\":\"String\"      \n   }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.permissions.type\n\n</td><td>\n\nType of permission.Valid values:\n\n-   group\n-   role\n-   user\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.permissions.value\n\n</td><td>\n\nSys\\_id of the group, role, or user to grant permissions.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.retiredDate\n\n</td><td>\n\nDate the project will be retired.Data type: String\n\n</td></tr></tbody>\n</table>This example creates a project using data from incidents created last month.\n\n```\nSNC.ProcessMiningIntegrationAPI\n.createProject(\n\"incident\", // table name\n[\"state\"], // activity definitions\n[\"priority\"], // breakdown definitions\n\"sys_created_onONLast month@javascript:gs.beginningOfLastMonth()@javascript:gs.endOfLastMonth()\", // incident created on last month\n\"DEFAULT\", // template type\n{\"02acf036b3120010ed7fc9c316a8dc0c\":\"user\"}, // map of permissions \"sys_id\":\"type\"\ntrue // auto retire project\n);\n```\n\nOutput:\n\n```\n{\n   \"entity\":{\n      \"table\":\"incident\",\n      \"condition\":\"sys_created_onONLast month@javascript:gs.beginningOfLastMonth()@javascript:gs.endOfLastMonth()\",\n      \"activityDefinitions\":[\n         {\n            \"field\":\"assignment_group\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         },\n         {\n            \"field\":\"business_service\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         },\n         {\n            \"field\":\"category\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         },\n         {\n            \"field\":\"priority\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         },\n         {\n            \"field\":\"state\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         }\n      ],\n      \"breakdownDefinitions\":[\n         {\n            \"field\":\"contact_type\",\n            \"fieldLabel\":\"Channel\"\n         },\n         {\n            \"field\":\"assignment_group\",\n            \"fieldLabel\":\"Assignment group\"\n         },\n         {\n            \"field\":\"location\",\n            \"fieldLabel\":\"Location\"\n         },\n         {\n            \"field\":\"priority\",\n            \"fieldLabel\":\"Priority\"\n         },\n         {\n            \"field\":\"category\",\n            \"fieldLabel\":\"Category\"\n         }\n      ]\n   },\n   \"name\":\"Incident Process\",\n   \"permissions\":[\n      {\n         \"value\":\"62826bf03710200044e0bfc8bcbe5df1\",\n         \"type\":\"user\"\n      },\n      {\n         \"value\":\"02acf036b3120010ed7fc9c316a8dc0c\",\n         \"type\":\"user\"\n      }\n   ],\n   \"id\":\"a4286c4f4f831210c98b8a4a91ce0bf5\",\n   \"miningState\":\"NEW\",\n   \"findingDefinitionKPIMap\":{\n      \"f23c20c34fc31210c98b8a4a91ce0bac\":[\n         \"002d65c3d7131100b96d45a3ce6103e2\"\n      ]\n   },\n   \"retiredDate\":null,\n   \"lastMined\":null\n}\n```\n\n## ProcessMiningIntegrationAPI - deleteProject\\(String projectId\\)\n\nDeletes a process mining project.\n\n<table id=\"table_cfn_f5t_kdc\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nprojectId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThis example deletes a process mining project.\n\n```\nSNC.ProcessMiningIntegrationAPI.deleteProject(\"a4286c4f4f831210c98b8a4a91ce0bf5\");\n```\n\n## ProcessMiningIntegrationAPI - getBreakDownStats\\(String projectId\\)\n\nGets breakdown statistics for a process mining project.\n\nBreakdowns allow you to filter records and analyze a process by categories, such as priority or business category.\n\n<table id=\"table_qqp_l5t_kdc\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nprojectId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\n</td></tr></tbody>\n</table><table id=\"table_rqp_l5t_kdc\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nArray\n\n</td><td>\n\nArray of breakdown objects. Each object contains statistics for the breakdown.```\n[\n   {\n      \"caseCount\": Number,\n      \"field\": \"String\",\n      \"fieldValue\": \"String\",\n      \"performanceStats\": {Object},\n      \"tableName\": \"String\",\n      \"variantCount\": Number     \n   }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.caseCount\n\n</td><td>\n\nNumber of cases from the Case Record \\[promin\\_case\\_record\\] table that are part of this breakdown.Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.field\n\n</td><td>\n\nField used for the breakdown.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.fieldValue\n\n</td><td>\n\nField value used for the breakdown.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats\n\n</td><td>\n\nPerformance statistics for the breakdown.```\n{\n   \"max\": Number,\n   \"mean\": Number,\n   \"median\": Number, \n   \"min\": Number,  \n   \"n\": Number, \n   \"q1\": Number, \n   \"q3\": Number, \n   \"q4\": Number, \n   \"stdDeviation\": Number, \n   \"sum\": Number, \n   \"total\": Number, \n   \"trimmedAverage\": Number, \n   \"trimmedPercentage\": Number\n}\n```\n\nData type: Object\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.max\n\n</td><td>\n\nLongest time a record took to complete a route.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.mean\n\n</td><td>\n\nAverage time that records took to complete a route, from the time records were opened to closed.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.median\n\n</td><td>\n\nDuration middle value, or average of two middle values.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.min\n\n</td><td>\n\nShortest time a record took to complete a route.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.n\n\n</td><td>\n\nNumber of records that are part of this breakdown.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.q1\n\n</td><td>\n\nDuration first quartile value.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.q3\n\n</td><td>\n\nDuration third quartile value.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.q4\n\n</td><td>\n\nDuration fourth quartile value \\(maximum\\).Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.stdDeviation\n\n</td><td>\n\nVariation from the route duration average value.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.sum\n\n</td><td>\n\nSum total of all duration times, from the first to the last event, for all records that follow a route.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.total\n\n</td><td>\n\nSum total of all duration times, from the first to the last event, for all records that follow a route.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.trimmedAverage\n\n</td><td>\n\nAverage time that records took to complete a route, calculated after removing a percentage of smallest and largest values.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.trimmedPercentage\n\n</td><td>\n\nPercentage used to calculate the **trimmedAverage** value.Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.tableName\n\n</td><td>\n\nTable used for the breakdown.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.variantCount\n\n</td><td>\n\nCount of variants \\(a unique sequence of activities performed in a process\\) corresponding to this breakdown. Data type: Number\n\n</td></tr></tbody>\n</table>This example gets breakdown statistics for a project.\n\n```\nSNC.ProcessMiningIntegrationAPI.getBreakDownStats(\"a4286c4f4f831210c98b8a4a91ce0bf5\");\n```\n\nOutput:\n\n```\n[\n   {\n      \"fieldValue\":\"1\",\n      \"field\":\"priority\",\n      \"tableName\":\"incident\",\n      \"variantCount\":21,\n      \"caseCount\":33,\n      \"performanceStats\":{\n         \"sum\":6.4945381E7,\n         \"min\":0.0,\n         \"max\":5.2334704E7,\n         \"n\":33,\n         \"median\":0.0,\n         \"mean\":0.0,\n         \"total\":64945381,\n         \"stdDeviation\":9144841.0,\n         \"trimmedAverage\":165594.0,\n         \"trimmedPercentage\":-1.0,\n         \"q1\":0.0,\n         \"q3\":313333.0,\n         \"q4\":5.2334704E7\n      }\n   }\n]\n```\n\n## ProcessMiningIntegrationAPI - getFindings\\(String projectId\\)\n\nGets findings for a process mining project.\n\n<table id=\"table_syh_k5t_kdc\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nprojectId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\n</td></tr></tbody>\n</table><table id=\"table_tyh_k5t_kdc\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nArray\n\n</td><td>\n\nArray of findings objects.```\n[\n   {\n      \"caseIds\":[Array],  \n      \"category\": \"String\",\n      \"categoryDescription\": \"String\",\n      \"categoryLabel\": \"String\",\n      \"createdOn\": Number, \n      \"findingDefId\": \"String\", \n      \"id\": \"String\",\n      \"impactedKpis\": [Array],\n      \"matchingRecords\": Number,\n      \"message\": \"String\",\n      \"performanceStats\": {Object},\n      \"shortMessage\": \"String\",\n      \"tableName\": \"String\",\n      \"totalRecords\": Number,\n      \"type\": \"String\",\n      \"typeLabel\": \"String\",    \n      \"versionId\": \"String\"  \n   }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.caseIds\n\n</td><td>\n\nList of IDs of cases that match the finding pattern. Located in the Case ID column of the Case Record \\[promin\\_case\\_record\\] table.Data type: Array\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.category\n\n</td><td>\n\nCategory of the finding.Possible values:\n\n-   AUTOMATION\n-   COMPLIANCE\n-   CONFORMANCE\n-   COST\n-   PERFORMANCE\n-   QUALITY\n-   SPEED\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.categoryDescription\n\n</td><td>\n\nDescription of the finding category.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.categoryLabel\n\n</td><td>\n\nLabel for the finding category.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.createdOn\n\n</td><td>\n\nCreation date of the finding.Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.findingDefId\n\n</td><td>\n\nSys\\_id of the improvement opportunity.Improvement opportunities are located in the Finding Definition \\[promin\\_finding\\_def\\] and Automated Finding Definition \\[promin\\_automated\\_finding\\] tables.\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.id\n\n</td><td>\n\nSys\\_id of the finding. Located in the Finding \\[promin\\_finding\\] table.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.impactedKpis\n\n</td><td>\n\nList of sys\\_ids of KPIs impacted by the finding. Located in the Indicator \\[pa\\_indicators\\] table.Data type: Array\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.matchingRecords\n\n</td><td>\n\nNumber of Case IDs from the Case Record \\[promin\\_case\\_record\\] table that match the finding pattern.Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.message\n\n</td><td>\n\nMessage from the improvement opportunity.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats\n\n</td><td>\n\nPerformance statistics for the finding.```\n{\n   \"max\": Number,\n   \"mean\": Number,\n   \"median\": Number, \n   \"min\": Number,  \n   \"n\": Number, \n   \"q1\": Number, \n   \"q3\": Number, \n   \"q4\": Number, \n   \"stdDeviation\": Number, \n   \"sum\": Number, \n   \"total\": Number, \n   \"trimmedAverage\": Number, \n   \"trimmedPercentage\": Number\n}\n```\n\nData type: Object\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.max\n\n</td><td>\n\nLongest time a record took to complete a route.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.mean\n\n</td><td>\n\nAverage time that records took to complete a route, from the time records were opened to closed.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.median\n\n</td><td>\n\nDuration middle value, or average of two middle values.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.min\n\n</td><td>\n\nShortest time a record took to complete a route.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.n\n\n</td><td>\n\nNumber of records that are part of this finding.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.q1\n\n</td><td>\n\nDuration first quartile value.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.q3\n\n</td><td>\n\nDuration third quartile value.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.q4\n\n</td><td>\n\nDuration fourth quartile value \\(maximum\\).Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.stdDeviation\n\n</td><td>\n\nVariation from the route duration average value.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.sum\n\n</td><td>\n\nSum total of all duration times, from the first to the last event, for all records that follow a route.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.total\n\n</td><td>\n\nSum total of all duration times, from the first to the last event, for all records that follow a route.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.trimmedAverage\n\n</td><td>\n\nAverage time that records took to complete a route, calculated after removing a percentage of smallest and largest values.Data type: Number\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.performanceStats.trimmedPercentage\n\n</td><td>\n\nPercentage used to calculate the **trimmedAverage** value.Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.shortMessage\n\n</td><td>\n\nShort message from the improvement opportunity.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.tableName\n\n</td><td>\n\nName of the table used in the finding.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.totalRecords\n\n</td><td>\n\nTotal number of records analyzed in the mining.Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.type\n\n</td><td>\n\nType of improvement opportunity.Possible values:\n\n-   EXTRA\\_STEP\n-   EXTREME\\_DURATION\n-   EXTREME\\_REPETITION\n-   OTHER\n-   PATTERN\n-   PERFORMANCE\\_OUTLIER\n-   PINGPONG\n-   REWORK\n\nFor more information, see [Setting Automated improvement opportunities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/automated-findings.md).\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.typeLabel\n\n</td><td>\n\nLabel for the improvement opportunity type.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Array&gt;.versionId\n\n</td><td>\n\nSys\\_id of the project version. Located in the Project Definition Version \\[promin\\_model\\_def\\_version\\] table.Data type: String\n\n</td></tr></tbody>\n</table>This example gets findings for a project.\n\n```\nSNC.ProcessMiningIntegrationAPI.getFindings(\"a4286c4f4f831210c98b8a4a91ce0bf5\");\n```\n\nOutput:\n\n```\n[\n   {\n      \"message\":\"Rework on Closed\",\n      \"id\":\"0ef09b2e1c6cf0d98045e6ba1c3c9edb\",\n      \"type\":\"REWORK\",\n      \"createdOn\":1727036052.000000000,\n      \"category\":\"AUTOMATION\",\n      \"tableName\":\"incident\",\n      \"categoryLabel\":\"Automation\",\n      \"matchingRecords\":111,\n      \"versionId\":\"9a2f187177b412102f7a1b56ba5a99e2\",\n      \"totalRecords\":19758,\n      \"findingDefId\":\"791f587177b412102f7a1b56ba5a99eb\",\n      \"categoryDescription\":\"Category that groups all opportunities that are subject to automation.\",\n      \"impactedKpis\":[\n         \n      ],\n      \"performanceStats\":{\n         \"sum\":2.09532828E8,\n         \"min\":1.0,\n         \"max\":6563078.0,\n         \"n\":111,\n         \"median\":1036715.0,\n         \"mean\":1.0,\n         \"total\":209532828,\n         \"stdDeviation\":1855944.0,\n         \"trimmedAverage\":1716904.0,\n         \"trimmedPercentage\":-1.0,\n         \"q1\":776859.0,\n         \"q3\":2246368.0,\n         \"q4\":6563078.0\n      },\n      \"typeLabel\":\"Automation\",\n      \"shortMessage\":\"Closed\",\n      \"caseIds\":[\n         \"119e4a569397fd14849bbcd74dba1018\",\n         \"b16b355f47197190498cc044846d43b0\",\n         \"cf9bca7597fe7d90ef889504a253af9e\",\n      ]\n   }\n]\n```\n\n## ProcessMiningIntegrationAPI - getMiningStatus\\(String projectId\\)\n\nGets the mining status of a process mining project.\n\n<table id=\"table_r12_j5t_kdc\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nprojectId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\n</td></tr></tbody>\n</table><table id=\"table_s12_j5t_kdc\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nObject\n\n</td><td>\n\nObject containing the project sys\\_id and a tracker. ```\n{\n   \"projectId\":\"String\",\n   \"trackerId\":\"String\"  \n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.projectId\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.trackerId\n\n</td><td>\n\nSys\\_id of the tracker that monitors the mining progress for the project.Table: Execution Tracker \\[sys\\_execution\\_tracker\\]\n\nData type: String\n\n</td></tr></tbody>\n</table>This example gets the mining status for a project.\n\n```\nSNC.ProcessMiningIntegrationAPI.getMiningStatus(\"c0b91f0cff01121047cae835f2cb14bc\");\n```\n\nOutput:\n\n```\n{\n   \"trackerId\":\"aec9530cff01121047cae835f2cb147e\",\n   \"projectId\":\"c0b91f0cff01121047cae835f2cb14bc\"\n}\n```\n\n## ProcessMiningIntegrationAPI - getProject\\(String projectId\\)\n\nRetrieves a process mining project.\n\n<table id=\"table_ik3_d5t_kdc\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nprojectId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\n</td></tr></tbody>\n</table><table id=\"id_x1l_krq_c2c\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nObject\n\n</td><td>\n\nObject containing information about the project.```\n{\n   \"entity\": {Object},\n   \"findingDefinitionKPIMap\": {Object},\n   \"id\": \"String\",\n   \"lastMined\": String\",\n   \"miningState\": \"String\",\n   \"name\": \"String\",\n   \"permissions\": [Array],\n   \"retiredDate\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity\n\n</td><td>\n\nObject containing information about the data analyzed in the project.Data type: Object\n\n```\n{\n   \"activityDefinitions\": [Array],\n   \"breakdownDefinitions\": [Array],\n   \"condition\": \"String,\"\n   \"table\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.activityDefinitions\n\n</td><td>\n\nActivity definitions for the project.Data type: Array\n\n```\n[\n   {\n      \"activityOfInterest\":Boolean,\n      \"field\":\"String\",\n      \"type\":\"String\"      \n   }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.activityDefinitions.activityOfInterest\n\n</td><td>\n\nFlag that indicates whether field changes appear in the analyst workbench.\n\n Valid values:\n\n-   true: Field changes appear in the analyst workbench.\n-   false: Field changes don’t appear in the analyst workbench, but can still be used in contextual conditions in transitions or findings.\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.activityDefinitions.field\n\n</td><td>\n\nField containing the data to analyze. The field must be from the table specified in the **table** parameter.\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.activityDefinitions.type\n\n</td><td>\n\nThe type of values to mine.Valid values:\n\n-   Field Values \\(Default\\): This is the default selection. This option is available whenever you create an activity definition.\n-   Date Time: Uses date time value from the actual record rather than the audit history and is displayed as a grouped node on the process map.\n-   Compound: One node or process graph representing change in the multiple field value from the actual record rather than the audit history.\n-   Child Attached: This option is available when you have selected two tables for table configuration and have set a child-parent relationship. This option is available only for the parent table configuration. In the visualization, you will see when the child was attached in the process.\n-   Parent Attached: This option creates a node on the child process representing when a parent record was attached to a child.\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.breakdownDefinitions\n\n</td><td>\n\nBreakdown definitions for the project.Data type: Array\n\n```\n[\n {\n   \"field\":\"String\",\n   \"fieldLabel\":\"String\"\n }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.breakdownDefinitions.field\n\n</td><td>\n\nName of the field used in the breakdown.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.breakdownDefinitions.fieldLabel\n\n</td><td>\n\nLabel of the field used in the breakdown.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.condition\n\n</td><td>\n\nEncoded query to select the data to analyze.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.entity.table\n\n</td><td>\n\nName of the table containing the data to analyze.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.findingDefinitionKPIMap\n\n</td><td>\n\nMap of improvement opportunities and key performance indicators \\(KPIs\\), where the map key is an improvement opportunity sys\\_id and the value is an array of sys\\_ids of the KPIs impacted by the improvement opportunity.Improvement opportunities are located in the Finding Definition \\[promin\\_finding\\_def\\] and Automated Finding Definition \\[promin\\_automated\\_finding\\] tables. KPIs are located in the Indicator \\[pa\\_indicators\\] table.\n\nFor more information about improvement opportunities and KPIs, see [Setting improvement opportunities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/working-with-imp-opp.md) and [Viewing business insights](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/view-business-findings.md).\n\nData type: Object\n\n```\n{\n   \"<finding_def_sys_id\":[\n      \"<kpi_sys_id>\"\n   ]\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.id\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.lastMined\n\n</td><td>\n\nDate the project was last mined.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.miningState\n\n</td><td>\n\nMining state for the project.For descriptions of mining states, see [Mining states](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/generate-process-map.md).\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.name\n\n</td><td>\n\nName of the project.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.permissions\n\n</td><td>\n\nGroup, role, and user permissions for the project.Data type: Object\n\n```\n[\n   {\n      \"type\":\"String\",\n      \"value\":\"String\"      \n   }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.permissions.type\n\n</td><td>\n\nType of permission.Valid values:\n\n-   group\n-   role\n-   user\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.permissions.value\n\n</td><td>\n\nSys\\_id of the group, role, or user to grant permissions.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.retiredDate\n\n</td><td>\n\nDate the project will be retired.Data type: String\n\n</td></tr></tbody>\n</table>This example retrieves a process mining project.\n\n```\nSNC.ProcessMiningIntegrationAPI.getProject(\"fa465748ff01121047cae835f2cb1473\");\n```\n\nOutput:\n\n```\n{\n   \"entity\":{\n      \"table\":\"incident\",\n      \"activityDefinitions\":[\n         {\n            \"field\":\"assignment_group\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         },\n         {\n            \"field\":\"business_service\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         },\n         {\n            \"field\":\"state\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         },\n         {\n            \"field\":\"category\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         },\n         {\n            \"field\":\"priority\",\n            \"type\":\"DEFAULT\",\n            \"activityOfInterest\":false\n         }\n      ],\n      \"condition\":\"\",\n      \"breakdownDefinitions\":[\n         {\n            \"field\":\"contact_type\",\n            \"fieldLabel\":\"Channel\"\n         },\n         {\n            \"field\":\"close_code\",\n            \"fieldLabel\":\"Resolution code\"\n         },\n         {\n            \"field\":\"assignment_group\",\n            \"fieldLabel\":\"Assignment group\"\n         },\n         {\n            \"field\":\"location\",\n            \"fieldLabel\":\"Location\"\n         },\n         {\n            \"field\":\"priority\",\n            \"fieldLabel\":\"Priority\"\n         },\n         {\n            \"field\":\"category\",\n            \"fieldLabel\":\"Category\"\n         }\n      ]\n   },\n   \"name\":\"Incident Process\",\n   \"permissions\":[\n      {\n         \"value\":\"some_group_sys_id\",\n         \"type\":\"group\"\n      },\n      {\n         \"value\":\"some_role_sys_id\",\n         \"type\":\"role\"\n      },\n      {\n         \"value\":\"some_user_sys_id\",\n         \"type\":\"user\"\n      }\n   ],\n   \"id\":\"fa465748ff01121047cae835f2cb1473\",\n   \"miningState\":\"NEW\",\n   \"findingDefinitionKPIMap\":{\n      \n   },\n   \"retiredDate\":1728292672.622894000,\n   \"lastMined\":null\n}\n```\n\n## ProcessMiningIntegrationAPI - scheduleMining\\(String projectId\\)\n\nSubmits a process mining project for mining.\n\n<table id=\"table_yyx_h5t_kdc\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nprojectId\n\n</td><td>\n\nString\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\n</td></tr></tbody>\n</table><table id=\"table_s12_j5t_kdc\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nObject\n\n</td><td>\n\nObject containing the project sys\\_id and a tracker. ```\n{\n   \"projectId\":\"String\",\n   \"trackerId\":\"String\"  \n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.projectId\n\n</td><td>\n\nSys\\_id of the project.Table: Project Definition \\[promin\\_project\\]\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.trackerId\n\n</td><td>\n\nSys\\_id of the tracker that monitors the mining progress for the project.Table: Execution Tracker \\[sys\\_execution\\_tracker\\]\n\nData type: String\n\n</td></tr></tbody>\n</table>This example submits a project for mining.\n\n```\nSNC.ProcessMiningIntegrationAPI.scheduleMining(\"c0b91f0cff01121047cae835f2cb14bc\");\n```\n\nOutput:\n\n```\n{\n   \"trackerId\":\"aec9530cff01121047cae835f2cb147e\",\n   \"projectId\":\"c0b91f0cff01121047cae835f2cb14bc\"\n}\n```\n\n"}}