-
Notifications
You must be signed in to change notification settings - Fork 6
/
apwCallJira.txt
33 lines (32 loc) · 1.42 KB
/
apwCallJira.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Call JIRA Rest API.
<p></p>
<h3>Available environment variables</h3>
<dl>
<dt>JIRA_BASE_URL</dt><dd>Jira base URL (e.g. http://jira.com), with/without context dependending on the way you expose it</dd>
<dt>JIRA_CREDENTIALS_ID</dt><dd>Jenkins credential id used to authenticate the Jira calls</dd>
<dt>JIRA_VERSION</dt><dd>Jira version (not used for the moment)</dd>
</dl>
<br/>
<h3>Available declarative attributes</h3>
<dl>
<dt>jiraBaseUrl</dt><dd>Base URL to talk to JIRA. (default: http://localhost:8080)</dd>
<dt>jiraCredentialsId</dt><dd>Credentials id for calling requiring to be authenticated</dd>
<dt>httpMode</dt><dd>HTTP Verb. One of 'GET', 'POST', 'PUT', 'DELETE'. (default: GET)</dd>
<dt>path</dt><dd>The path of the call. (default: '')</dd>
<dt>body</dt><dd>Body of the request (not authorized on GET)</dd>
<dt>buildFailOnError</dt><dd>Fail build if call is failing. (default: true)</dd>
</dl>
<br/>
<p>Usage example:</p>
<pre><code>
def project = jira jiraBaseUrl:'http://localhost:2990/jira', jiraCredentialsId:'localhost-jira-admin', httpMode:'GET', path:'/rest/api/2/project/10000'
</code></pre>
<p>if jiraBaseUrl is omitted, only path will be used.</p>
<p>Usage if environment variable defined:</p>
<pre><code>
def project = jira path:'/rest/api/2/project/10000'
</code></pre>
<p>Same example but with named global vars:</p>
<pre><code>
def project = apwCallJiraGetProject id: '10000'
</code></pre>