diff --git a/vars/updateCard.groovy b/vars/updateCard.groovy new file mode 100644 index 0000000..d107646 --- /dev/null +++ b/vars/updateCard.groovy @@ -0,0 +1,11 @@ +def call(String id) { + configFileProvider([configFile(fileId: 'trello', variable: 'configfile')]) { + def config = readJSON(text: readFile(file: configfile)) + String data = """{"idValue": "${config['results'][currentBuild.currentResult]}"}""" + def response = httpRequest(contentType: 'APPLICATION_JSON', + httpMode: 'PUT', + url: "https://api.trello.com/1/card/${id}/customField/${config['field']}/item?key=${config['key']}&token=${config['token']}", + requestBody: data + ) + } +}