How to bulk update a large volume of issues with iHub
This use case is where you have a large volume of issues that needs to be update.
Â
Â
Step 1. Get the issues to update
Go to Issue Navigator in Jira and create a filter that includes the issues needed to be updated.
Save the filter and copy the filter id from the URL
Go to iHub and click Create
Name the action Get Issue Data to be updated
Select Template Category: Jira Core Server
Select Template: Search
Click Create
Go to the URL part and add ?jql=filter=THE_ID_COPIED_IN_STEP_2
Check the checkbox next to the URL called Pagination
This will expand the pagination settings, since Jira will return 50 at the time you will need to read each page. Paginated requests
Sample response{ "expand": "schema,names", "startAt": 0, "maxResults": 50, "total": 167, "issues": [] }
Add this to the breaking path: $.issues
click Add in the pagination table enter
startAt
as the value and FIXED VALUE as type and additional value 0Save the action
Â
Step 2 - Iterate each page of issues
Click create and select the Get Issue Data to be updated action created in step 1 as parent
Select Action type: Iteration
Click Create
Add $.issues as JSON path
Step - Update an issue
Now create a child action by clicking the Create button again
Enter a name, Update issue
Select the iteration created in step 2 as parent
Select Template Category: Jira Core Server
Select Template: Edit Issue
Click create
Select the authentication user (BASIC AUTH)
Modify the URL to be {{baseUrl}}/rest/api/2/issue/{{key}}
This because each iteration will provide the child action with a payload similar to the one below{ "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields", "id": "10752", "self": "https://testsup.rixter.se/rest/api/2/issue/10752", "key": "ITSUP-34", "fields": { "issuetype": { "self": "https://testsup.rixter.se/rest/api/2/issuetype/10100", "id": "10100", "description": "For system outages or incidents. Created by Jira Service Desk.", "iconUrl": "https://testsup.rixter.se/secure/viewavatar?size=xsmall&avatarId=10700&avatarType=issuetype", "name": "Incident", "subtask": false, "avatarId": 10700 }, "timespent": null, "project": { "self": "https://testsup.rixter.se/rest/api/2/project/10201", "id": "10201", "key": "ITSUP", "name": "IT Support", "projectTypeKey": "service_desk", "avatarUrls": { "48x48": "https://testsup.rixter.se/secure/projectavatar?avatarId=10324", "24x24": "https://testsup.rixter.se/secure/projectavatar?size=small&avatarId=10324", "16x16": "https://testsup.rixter.se/secure/projectavatar?size=xsmall&avatarId=10324", "32x32": "https://testsup.rixter.se/secure/projectavatar?size=medium&avatarId=10324" } }, "fixVersions": [], "customfield_10110": { "_links": { "jiraRest": "https://testsup.rixter.se/rest/api/2/issue/10752", "web": "https://testsup.rixter.se/servicedesk/customer/portal/2/ITSUP-34", "self": "https://testsup.rixter.se/rest/servicedeskapi/request/10752" }, "requestType": { "id": "30", "_links": { "self": "https://testsup.rixter.se/rest/servicedeskapi/servicedesk/2/requesttype/30" }, "name": "Report a system problem", "description": "Having trouble with a system?", "helpText": "", "serviceDeskId": "2", "groupIds": [ "6" ], "icon": { "id": "10638", "_links": { "iconUrls": { "48x48": "https://testsup.rixter.se/secure/viewavatar?avatarType=SD_REQTYPE&size=large&avatarId=10638", "24x24": "https://testsup.rixter.se/secure/viewavatar?avatarType=SD_REQTYPE&size=small&avatarId=10638", "16x16": "https://testsup.rixter.se/secure/viewavatar?avatarType=SD_REQTYPE&size=xsmall&avatarId=10638", "32x32": "https://testsup.rixter.se/secure/viewavatar?avatarType=SD_REQTYPE&size=medium&avatarId=10638" } } } }, "currentStatus": { "status": "Closed", "statusDate": { "iso8601": "2021-02-15T09:39:20+0100", "jira": "2021-02-15T08:39:20.902+0000", "friendly": "15/Feb/21 9:39 AM", "epochMillis": 1613378360902 } } }, "customfield_10111": [], "aggregatetimespent": null, "resolution": { "self": "https://testsup.rixter.se/rest/api/2/resolution/10000", "id": "10000", "description": "Work has been completed on this issue.", "name": "Done" }, "resolutiondate": "2021-02-10T08:39:20.000+0000", "workratio": -1, "lastViewed": null, "watches": { "self": "https://testsup.rixter.se/rest/api/2/issue/ITSUP-34/watchers", "watchCount": 0, "isWatching": false }, "created": "2021-02-10T08:37:03.000+0000", .... more entries
Go down to the Body and add the code below
note that different custom fields has different formats needed.{ "fields":{"customfield_10201":"MY AWESOME VALUE"} }
Save the action
Go to the first action and click Test, do not enter any issue key.
This will take some time to run for large datasets, you can always check the execution log to see that it still runs.
Â
More material