SAP Knowledge Base Article - Public

3161623 - Create Jira issues with a JavaScript Task in Signavio Workflow Accelerator

Symptom

 

Is there a possibility to create Jira Issues due the API of Jira with the Signavio Workflow Accelerator?

Resolution

With the JavaScript Task is it possible to connect to 3rd party systems.

You can use the following code snippet.

Please keep in mind. Signavio will not take any responsibility for the code. Please test it in a developer/test environment before use it in production system.

Example create Jira Issue
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
34
35
36
37
38
39
40
41
42
43
// Create Jira issue: add a 'product feedback' issue to the selected project.
 
// Look up JIRA project details by product name.
const projects = {
  'My Project': {key: 'MY'},
  'My Other Project': {key: 'MOP'}
}
// Issue type ID
const productFeedback = 11101
const jiraProject = projects[projectName]
const user = 'myuser'
const password = 'mypassword'
 
const issueBody = {
  fields: {
    project: { key: jiraProject.key },
    summary: `${feedbackType}: ${summary}`,
    description: issueDescription,
    issuetype: { id: productFeedback }
  }
}
 
const requestOptions = {
  url: newIssueUrl,
  auth: { username: user, password: password },
  body: issueBody,
  json: true
}
 
const handleResponse = (error, response, body) => {
  if (error) {
    throw error
  }
  console.info(`HTTP ${response.statusCode} ${response.statusMessage}`)
  if (response && response.statusCode >= 400) {
    throw new Error(`Error: ${response.statusCode}\n${JSON.stringify(body)}`)
  }
  jiraIssueKey = body.key
  issueLink = `https://jira.example.com/browse/${body.key}`
}
 
request.post(requestOptions, handleResponse)

For Onpremise Systems you have to install NodeJS 

Keywords

javascript, process governance, workflow, nodejs , KBA , BPI-SIG-CA-API , REST-API for SAP Signavio , How To

Product

SAP Signavio Process Governance all versions ; Workflow Accelerator by Signavio all versions