Skip to content

Commit

Permalink
Use private token instead of OAuth token
Browse files Browse the repository at this point in the history
  • Loading branch information
tobigremmer-dt committed Oct 6, 2023
1 parent ae550e4 commit f050217
Showing 1 changed file with 4 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,43 +79,19 @@
"description": "Retrieves entity and extracts ownership data from it.",
"predecessors": ["query_service_entities"]
},
"refresh_gitlab_token": {
"action": "dynatrace.automations:http-function",
"conditions": {
"custom": "{{`{{`}} (result('identify_ownership').owners | length > 0) {{`}}`}}",
"states": {
"identify_ownership": "OK"
}
},
"description": "refresh gitlab token",
"input": {
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"url": "{{ .gitlab_url }}/oauth/token",
"payload": "{\"grant_type\": \"password\",\"username\": \"{{ .gitlab_username }}\",\"password\": \"{{ .gitlab_passwd }}\"}"
},
"name": "refresh_gitlab_token",
"position": {
"x": 0,
"y": 4
},
"predecessors": ["identify_ownership"]
},
"create_gitlab_issue": {
"action": "dynatrace.automations:http-function",
"conditions": {
"custom": "{{`{{`}} (result('identify_ownership').owners | length > 0) {{`}}`}}",
"states": {
"refresh_gitlab_token": "OK"
"identify_ownership": "OK"
}
},
"description": "{{ .gitlab_task_description }}",
"input": {
"headers": {
"Content-Type": "application/json",
"PRIVATE-TOKEN": "{{`{{`}} result(\"refresh_gitlab_token\").json.access_token {{`}}`}}"
"PRIVATE-TOKEN": "{{ .gitlab_private_token }}"
},
"method": "POST",
"url": "{{ .gitlab_url }}/api/v4/projects/{{`{{`}} result(\"identify_ownership\").owners[0].contactDetails | selectattr('integrationType', 'equalto', 'JIRA') | map(attribute='jira.project') | first() {{`}}`}}/issues",
Expand All @@ -124,9 +100,9 @@
"name": "create_gitlab_issue",
"position": {
"x": 0,
"y": 5
"y": 4
},
"predecessors": ["refresh_gitlab_token"]
"predecessors": ["identify_ownership"]
}
}
}

0 comments on commit f050217

Please sign in to comment.