// Define a JQL query to search for the issues on which you want to update the resolution
final jqlQuery = "project = TEST AND issueType = Bug"
// The Name of the resolution to be set
def resolutionName = 'Duplicate'
// Search for the issues we want to update
def searchReq = get("/rest/api/2/search")
// Verify the search completed successfully
assert searchReq.status == 200
// Save the search results as a Map
def searchResult = searchReq.body as Map
def issues = searchResult.issues as List