workflow: add invoke-issue-restapi and invoke-project-restapi actions
The invoke-issue-restapi invokes RestAPI on the issue, it uses soy
template to generate the request.
action = invoke-issue-restapi method uri passCodes template
The invoke-project-restapi is similar but invokes project method.
These commands enables advanced integration with most of JIRA features.
For example if you would like to create a link in issues to review, use
the following action:
action = invoke-issue-restapi POST /remotelink 200,201 link
With the follwing `its/templates/link.soy` template:
{namespace etc.its.templates}
{template .link}
{@param changeUrl: string}
{@param subject: string}
{@param status: string}
{lb}
"globalId": "{$changeUrl}",
"application": {lb}
"type": "com.googlesource.gerrit",
"name": "Gerrit"
{rb},
"object": {lb}
"url": "{$changeUrl}",
"title": "{$subject}",
"icon": {lb}
"url16x16": "https://www.gerritcodereview.com/images/diffy_logo.png",
"title": "Review"
{rb},
"status": {lb}
{switch $status}
{case null}
"resolved": false
{case 'NEW'}
"resolved": false
{case 'SUBMITTED'}
"resolved": false
{case 'MERGED'}
"resolved": true
{case 'ABANDONED'}
"resolved": true
{/switch}
{rb}
{rb}
{rb}
{/template}
Change-Id: I617c110764d48ed9dd2162c5414945e0d7b9d90c
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
9 files changed