From dfa100c990a7cb5619a1700fb34b8e29faad2dee Mon Sep 17 00:00:00 2001 From: mkarmah Date: Thu, 16 May 2024 23:56:12 +0000 Subject: [PATCH 1/4] updated pagerduty actions --- .../PagerDuty/acknowledge-incident.md | 8 +- .../examples/PagerDuty/change-on-call-user.md | 8 +- .../change-pagerduty-incident-owner.md | 8 +- .../PagerDuty/create-pagerduty-service.md | 71 +++++++++++++----- .../PagerDuty/escalate-an-incident.md | 13 ++-- .../examples/PagerDuty/resolve-incident.md | 12 +-- .../PagerDuty/trigger-pagerduty-incident.md | 74 ++++++++++++++++--- 7 files changed, 147 insertions(+), 47 deletions(-) diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/acknowledge-incident.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/acknowledge-incident.md index f371de438..dc41a3223 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/acknowledge-incident.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/acknowledge-incident.md @@ -70,7 +70,7 @@ jobs: { "incidents": [ { - "id": "${{ fromJson(inputs.port_payload).port_context.entity }}", + "id": "${{ fromJson(inputs.port_context).entity }}", "type": "incident_reference", "status": "acknowledged" } @@ -114,6 +114,7 @@ jobs: "created_at": "${{ fromJson(steps.acknowledge_incident.outputs.response).incidents[0].created_at }}", "updated_at": "${{ fromJson(steps.acknowledge_incident.outputs.response).incidents[0].updated_at }}" } + relations: "${{ toJson(fromJson(inputs.port_context).relations) }}" clientId: ${{ secrets.PORT_CLIENT_ID }} clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} baseUrl: https://api.getport.io @@ -191,8 +192,9 @@ Create a new self service action using the following JSON configuration. "{{if (.inputs | has(\"from\")) then \"from\" else null end}}": "{{.inputs.\"from\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", - "entity": "{{.entity}}", - "run_id": "{{.run.id}}" + "entity": "{{.entity.identifier}}", + "run_id": "{{.run.id}}", + "relations": "{{.entity.relations}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md index 80200f2a9..17f906d17 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md @@ -173,6 +173,7 @@ jobs: "description": "${{ fromJson(steps.new_schedule.outputs.response).schedule.description}}", "users": ${{ env.user_summaries }} } + relations: "${{ toJson(fromJson(inputs.port_context).relations) }}" clientId: ${{ secrets.PORT_CLIENT_ID }} clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} baseUrl: https://api.getport.io @@ -250,7 +251,7 @@ Create a new self service action using the following JSON configuration. "type": "GITHUB", "org": "", "repo": "", - "workflow": "change-incident-owner.yaml", + "workflow": "change-on-call-user.yaml", "workflowInputs": { "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", "{{if (.inputs | has(\"start_time\")) then \"start_time\" else null end}}": "{{.inputs.\"start_time\"}}", @@ -258,8 +259,9 @@ Create a new self service action using the following JSON configuration. "{{if (.inputs | has(\"new_on_call_user\")) then \"new_on_call_user\" else null end}}": "{{.inputs.\"new_on_call_user\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", - "entity": "{{.entity}}", - "run_id": "{{.run.id}}" + "entity": "{{.entity.identifier}}", + "run_id": "{{.run.id}}", + "relations": "{{.entity.relations}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md index 34afc07e9..0f0b8b53f 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md @@ -217,6 +217,7 @@ jobs: "created_at": "${{ fromJson(steps.change_owner.outputs.response).incident.created_at }}", "updated_at": "${{ fromJson(steps.change_owner.outputs.response).incident.updated_at }}" } + relations: "${{ toJson(fromJson(inputs.port_context).relations) }}" clientId: ${{ secrets.PORT_CLIENT_ID }} clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} baseUrl: https://api.getport.io @@ -290,12 +291,13 @@ Create a new self service action using the following JSON configuration. "workflow": "change-incident-owner.yaml", "workflowInputs": { "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", - "{{if (.inputs | has(\"new_owner_user_id\")) then \"new_owner_user_id\" else null end}}": "{{.inputs.\"new_owner_user_id\"}}", + "{{if (.inputs | has(\"new_owner\")) then \"new_owner\" else null end}}": "{{.inputs.\"new_owner\"}}", "{{if (.inputs | has(\"from\")) then \"from\" else null end}}": "{{.inputs.\"from\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", - "entity": "{{.entity}}", - "run_id": "{{.run.id}}" + "entity": "{{.entity.identifier}}", + "run_id": "{{.run.id}}", + "relations": "{{.entity.relations}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/create-pagerduty-service.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/create-pagerduty-service.md index ae3e5ee0e..67997e764 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/create-pagerduty-service.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/create-pagerduty-service.md @@ -69,11 +69,26 @@ jobs: "service": { "name": "${{ github.event.inputs.name }}", "description": "${{ github.event.inputs.description }}", - "escalation_policy": ${{ github.event.inputs.escalation_policy }} + "status": "active", + "escalation_policy": { + "id": "${{ github.event.inputs.escalation_policy }}", + "type": "escalation_policy_reference" + } + } } - } - - - name: Create a log message + + - name: Log Create Service Request Failure + if: failure() + uses: port-labs/port-github-action@v1 + with: + clientId: ${{ secrets.PORT_CLIENT_ID }} + clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} + baseUrl: https://api.getport.io + operation: PATCH_RUN + runId: ${{fromJson(inputs.port_context).run_id}} + logMessage: "Request to create service failed ..." + + - name: Log Request Success uses: port-labs/port-github-action@v1 with: clientId: ${{ secrets.PORT_CLIENT_ID }} @@ -83,17 +98,37 @@ jobs: runId: ${{fromJson(inputs.port_context).run_id}} logMessage: | PagerDuty service created! ✅ - Requesting for oncalls + Requesting for on-calls - - name: Request for oncalls for escalation_policy + - name: Request for oncalls for Escalation Policy id: fetch_oncalls uses: fjogeleit/http-request-action@v1 with: - url: 'https://api.pagerduty.com/oncalls?include[]=users&escalation_policy_ids[]=${{ fromJson(github.event.inputs.escalation_policy).id }}' + url: 'https://api.pagerduty.com/oncalls?include[]=users&escalation_policy_ids[]=${{ inputs.escalation_policy }}' method: 'GET' customHeaders: '{"Content-Type": "application/json", "Accept": "application/json", "Authorization": "Token token=${{ secrets.PAGERDUTY_API_KEY }}"}' - - name: Create a log message + - name: Extract User Emails + if: steps.fetch_oncalls.outcome == 'success' + id: extract_user_emails + run: | + echo "Extracting user emails..." + EMAILS=$(echo '${{ steps.fetch_oncalls.outputs.response }}' | jq -c '[.oncalls[].user.email]') + echo "Extracted emails: $EMAILS" + echo "user_emails=${EMAILS}" >> $GITHUB_ENV + + - name: Log Fetch Oncalls Request Failure + if: steps.fetch_oncalls.outcome == 'failure' + uses: port-labs/port-github-action@v1 + with: + clientId: ${{ secrets.PORT_CLIENT_ID }} + clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} + baseUrl: https://api.getport.io + operation: PATCH_RUN + runId: ${{fromJson(inputs.port_context).run_id}} + logMessage: Failed to fetch on-calls ❌ + + - name: Log Before Upserting Entity uses: port-labs/port-github-action@v1 with: clientId: ${{ secrets.PORT_CLIENT_ID }} @@ -108,24 +143,23 @@ jobs: uses: port-labs/port-github-action@v1 with: identifier: "${{ fromJson(steps.create_service_request.outputs.response).service.id }}" - title: "${{ fromJson(steps.create_service_request.outputs.response).service.summary }}" - team: "[]" + title: "${{ fromJson(steps.create_service_request.outputs.response).service.summary }}" icon: pagerduty - blueprint: ${{fromJson(inputs.port_context).blueprint}} + blueprint: "${{fromJson(inputs.port_context).blueprint}}" properties: |- { "status": "${{ fromJson(steps.create_service_request.outputs.response).service.status }}", "url": "${{ fromJson(steps.create_service_request.outputs.response).service.html_url }}", - "oncall": "${{ fromJson(steps.fetch_oncalls).oncalls }}" + "oncall": ${{ env.user_emails }} } - relations: "{}" + relations: "${{ toJson(fromJson(inputs.port_context).relations) }}" clientId: ${{ secrets.PORT_CLIENT_ID }} clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} baseUrl: https://api.getport.io operation: UPSERT runId: ${{fromJson(inputs.port_context).run_id}} - - name: Create a log message + - name: Log After Upserting Entity uses: port-labs/port-github-action@v1 with: clientId: ${{ secrets.PORT_CLIENT_ID }} @@ -134,7 +168,7 @@ jobs: operation: PATCH_RUN runId: ${{fromJson(inputs.port_context).run_id}} logMessage: | - Upsert was successful ✅ + Upserting was successful ✅ ``` @@ -175,7 +209,7 @@ Create a new self service action using the following JSON configuration. "description": "PagerDuty Escalation Policy ID to apply", "icon": "pagerduty", "type": "string" - }, + } }, "required": [ "name", @@ -201,8 +235,9 @@ Create a new self service action using the following JSON configuration. "{{if (.inputs | has(\"escalation_policy\")) then \"escalation_policy\" else null end}}": "{{.inputs.\"escalation_policy\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", - "entity": "{{.entity}}", - "run_id": "{{.run.id}}" + "entity": "{{.entity.identifier}}", + "run_id": "{{.run.id}}", + "relations": "{{.entity.relations}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/escalate-an-incident.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/escalate-an-incident.md index 6842af91d..5f18b53e6 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/escalate-an-incident.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/escalate-an-incident.md @@ -72,7 +72,7 @@ jobs: id: escalate_incident uses: fjogeleit/http-request-action@v1 with: - url: 'https://api.pagerduty.com/incidents/${{inputs.entity_identifier}}' + url: 'https://api.pagerduty.com/incidents/${{fromJson(inputs.port_context).entity}}' method: 'PUT' customHeaders: '{"Content-Type": "application/json", "Accept": "application/vnd.pagerduty+json;version=2", "Authorization": "Token token=${{ secrets.PAGERDUTY_API_KEY }}", "From": "${{ github.event.inputs.from }}"}' data: >- @@ -109,6 +109,7 @@ jobs: logMessage: "Reporting the escalated incident back to Port ..." - name: Upsert pagerduty entity to Port + id: upsert_entity uses: port-labs/port-github-action@v1 with: identifier: ${{inputs.entity_identifier}} @@ -124,6 +125,7 @@ jobs: "created_at": "${{ fromJson(steps.escalate_incident.outputs.response).incident.created_at }}", "updated_at": "${{ fromJson(steps.escalate_incident.outputs.response).incident.updated_at }}" } + relations: "${{ toJson(fromJson(inputs.port_context).relations) }}" clientId: ${{ secrets.PORT_CLIENT_ID }} clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} baseUrl: https://api.getport.io @@ -131,7 +133,7 @@ jobs: runId: ${{fromJson(inputs.port_context).run_id}} - name: Inform Entity upsert failure - if: failure() + if: steps.upsert_entity.outcome == 'failure' uses: port-labs/port-github-action@v1 with: clientId: ${{ secrets.PORT_CLIENT_ID }} @@ -141,7 +143,7 @@ jobs: runId: ${{fromJson(inputs.port_context).run_id}} logMessage: "Failed to report the escalated incident back to Port ..." - - name: Inform completion of PagerDuty escalation process into Port + - name: Inform completion of PagerDuty incident escalation uses: port-labs/port-github-action@v1 with: clientId: ${{ secrets.PORT_CLIENT_ID }} @@ -227,8 +229,9 @@ Create a new self service action using the following JSON configuration. "{{if (.inputs | has(\"from\")) then \"from\" else null end}}": "{{.inputs.\"from\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", - "entity": "{{.entity}}", - "run_id": "{{.run.id}}" + "entity": "{{.entity.identifier}}", + "run_id": "{{.run.id}}", + "relations": "{{.entity.relations}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/resolve-incident.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/resolve-incident.md index db8705d26..bc3f09861 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/resolve-incident.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/resolve-incident.md @@ -71,7 +71,7 @@ jobs: { "incidents": [ { - "id": "${{ fromJson(inputs.port_payload).port_context.entity }}", + "id": "${{fromJson(inputs.port_context).entity}}", "type": "incident_reference", "status": "resolved" } @@ -114,6 +114,7 @@ jobs: "created_at": "${{ fromJson(steps.resolve_incident.outputs.response).incidents[0].created_at }}", "updated_at": "${{ fromJson(steps.resolve_incident.outputs.response).incidents[0].updated_at }}" } + relations: "${{ toJson(fromJson(inputs.port_context).relations) }}" clientId: ${{ secrets.PORT_CLIENT_ID }} clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} baseUrl: https://api.getport.io @@ -169,16 +170,17 @@ Create a new self service action using the following JSON configuration. }, "invocationMethod": { "type": "GITHUB", - "org": "", - "repo": "", + "org": "GITHUB_ORG", + "repo": "GITHUB_REPO", "workflow": "resolve-incident.yaml", "workflowInputs": { "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", "{{if (.inputs | has(\"from\")) then \"from\" else null end}}": "{{.inputs.\"from\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", - "entity": "{{.entity}}", - "run_id": "{{.run.id}}" + "entity": "{{.entity.identifier}}", + "run_id": "{{.run.id}}", + "relations": "{{.entity.relations}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/trigger-pagerduty-incident.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/trigger-pagerduty-incident.md index 7d7979210..d117eeabc 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/trigger-pagerduty-incident.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/trigger-pagerduty-incident.md @@ -55,8 +55,7 @@ on: jobs: trigger-incident: runs-on: ubuntu-latest - steps: - + steps: - name: Inform starting of PagerDuty trigger uses: port-labs/port-github-action@v1 with: @@ -66,6 +65,7 @@ jobs: runId: ${{fromJson(inputs.port_context).run_id}} logMessage: | About to trigger PagerDuty incident.. ⛴️ + - name: Send Event to PagerDuty id: trigger uses: fjogeleit/http-request-action@v1 @@ -76,14 +76,68 @@ jobs: data: >- { "payload": { - "summary": ${{ github.event.inputs.summary }}, - "source": ${{ github.event.inputs.source }}, - "severity": ${{ github.event.inputs.severity }}, + "summary": "${{ github.event.inputs.summary }}", + "source": "${{ github.event.inputs.source }}", + "severity": "${{ github.event.inputs.severity }}" }, "event_action": "${{ github.event.inputs.event_action }}", "routing_key": "${{ github.event.inputs.routing_key }}" } - - name: Create a log message + - name: Get PagerDuty Incident Details + id: get_incident + uses: fjogeleit/http-request-action@v1 + with: + url: 'https://api.pagerduty.com/incidents/${{fromJson(inputs.port_context).entity}}' + method: 'GET' + customHeaders: '{"Content-Type": "application/json", "Accept": "application/vnd.pagerduty+json;version=2", "Authorization": "Token token=${{ secrets.PAGERDUTY_API_KEY }}"}' + + - name: Log Before Upserting Entity + uses: port-labs/port-github-action@v1 + with: + clientId: ${{ secrets.PORT_CLIENT_ID }} + clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} + baseUrl: https://api.getport.io + operation: PATCH_RUN + runId: ${{fromJson(inputs.port_context).run_id}} + logMessage: "Reporting the updated incident back to port ..." + + - name: UPSERT Entity + uses: port-labs/port-github-action@v1 + with: + identifier: "${{ fromJson(steps.get_incident.outputs.response).incident.id }}" + title: "${{ fromJson(steps.get_incident.outputs.response).incident.title }}" + team: "[]" + icon: "pagerduty" + blueprint: "${{fromJson(inputs.port_context).blueprint}}" + properties: |- + { + "status": "${{ fromJson(steps.get_incident.outputs.response).incident.status }}", + "url": "${{ fromJson(steps.get_incident.outputs.response).incident.self }}", + "urgency": "${{ fromJson(steps.get_incident.outputs.response).incident.urgency }}", + "responder": "${{ fromJson(steps.get_incident.outputs.response).incident.assignments[0].assignee.summary }}", + "escalation_policy": "${{ fromJson(steps.get_incident.outputs.response).incident.escalation_policy.summary }}", + "created_at": "${{ fromJson(steps.get_incident.outputs.response).incident.created_at }}", + "updated_at": "${{ fromJson(steps.get_incident.outputs.response).incident.updated_at }}" + } + relations: "${{ toJson(fromJson(inputs.port_context).relations) }}" + clientId: ${{ secrets.PORT_CLIENT_ID }} + clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} + baseUrl: https://api.getport.io + operation: UPSERT + runId: ${{fromJson(inputs.port_context).run_id}} + + - name: Inform Entity upsert failure + if: steps.upsert_entity.outcome == 'failure' + uses: port-labs/port-github-action@v1 + with: + clientId: ${{ secrets.PORT_CLIENT_ID }} + clientSecret: ${{ secrets.PORT_CLIENT_SECRET }} + baseUrl: https://api.getport.io + operation: PATCH_RUN + runId: ${{fromJson(inputs.port_context).run_id}} + logMessage: "Failed to report the triggered incident back to Port ..." + + - name: Log After Upserting Entity id: log-response uses: port-labs/port-github-action@v1 with: @@ -94,7 +148,6 @@ jobs: runId: ${{fromJson(inputs.port_context).run_id}} logMessage: | PagerDuty incident triggered! ✅ - "The incident id is: ${{ steps.trigger.outputs}}" ``` @@ -146,7 +199,7 @@ Create a new self service action using the following JSON configuration. "title": "Summary", "icon": "pagerduty", "description": "A brief text summary of the event, used to generate the summaries/titles of any associated alerts. The maximum permitted length of this property is 1024 characters.", - "minLength": 1024 + "maxLength": 1024 }, "source": { "type": "string", @@ -205,8 +258,9 @@ Create a new self service action using the following JSON configuration. "{{if (.inputs | has(\"routing_key\")) then \"routing_key\" else null end}}": "{{.inputs.\"routing_key\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", - "entity": "{{.entity}}", - "run_id": "{{.run.id}}" + "entity": "{{.entity.identifier}}", + "run_id": "{{.run.id}}", + "relations": "{{.entity.relations}}" } }, "reportWorkflowStatus": true From 5eb19712332a2319193c7d75ccae04a8103abb92 Mon Sep 17 00:00:00 2001 From: mkarmah Date: Mon, 20 May 2024 10:33:11 +0000 Subject: [PATCH 2/4] updated workflow inputs --- .../examples/PagerDuty/acknowledge-incident.md | 6 ++---- .../examples/PagerDuty/change-on-call-user.md | 14 ++++++-------- .../PagerDuty/change-pagerduty-incident-owner.md | 9 ++++----- .../examples/PagerDuty/create-pagerduty-service.md | 10 ++++------ .../examples/PagerDuty/escalate-an-incident.md | 10 ++++------ .../examples/PagerDuty/resolve-incident.md | 7 +++---- .../PagerDuty/trigger-pagerduty-incident.md | 11 +++++------ 7 files changed, 28 insertions(+), 39 deletions(-) diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/acknowledge-incident.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/acknowledge-incident.md index dc41a3223..344cb6bc6 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/acknowledge-incident.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/acknowledge-incident.md @@ -188,13 +188,11 @@ Create a new self service action using the following JSON configuration. "repo": "", "workflow": "acknowledge-incidents.yaml", "workflowInputs": { - "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", - "{{if (.inputs | has(\"from\")) then \"from\" else null end}}": "{{.inputs.\"from\"}}", + "from": "{{.inputs.\"from\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", "entity": "{{.entity.identifier}}", - "run_id": "{{.run.id}}", - "relations": "{{.entity.relations}}" + "run_id": "{{.run.id}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md index 17f906d17..8ba5cd968 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md @@ -249,19 +249,17 @@ Create a new self service action using the following JSON configuration. }, "invocationMethod": { "type": "GITHUB", - "org": "", - "repo": "", + "org": "mk-armah", + "repo": "jira-actions", "workflow": "change-on-call-user.yaml", "workflowInputs": { - "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", - "{{if (.inputs | has(\"start_time\")) then \"start_time\" else null end}}": "{{.inputs.\"start_time\"}}", - "{{if (.inputs | has(\"end_time\")) then \"end_time\" else null end}}": "{{.inputs.\"end_time\"}}", - "{{if (.inputs | has(\"new_on_call_user\")) then \"new_on_call_user\" else null end}}": "{{.inputs.\"new_on_call_user\"}}", + "start_time": "{{.inputs.\"start_time\"}}", + "end_time": "{{.inputs.\"end_time\"}}", + "new_on_call_user": "{{.inputs.\"new_on_call_user\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", "entity": "{{.entity.identifier}}", - "run_id": "{{.run.id}}", - "relations": "{{.entity.relations}}" + "run_id": "{{.run.id}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md index 0f0b8b53f..8038615ab 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md @@ -290,14 +290,13 @@ Create a new self service action using the following JSON configuration. "repo": "", "workflow": "change-incident-owner.yaml", "workflowInputs": { - "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", - "{{if (.inputs | has(\"new_owner\")) then \"new_owner\" else null end}}": "{{.inputs.\"new_owner\"}}", - "{{if (.inputs | has(\"from\")) then \"from\" else null end}}": "{{.inputs.\"from\"}}", + "inputs": "{{.inputs.\"ref\"}}", + "new_owner": "{{.inputs.\"new_owner\"}}", + "from": "{{.inputs.\"from\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", "entity": "{{.entity.identifier}}", - "run_id": "{{.run.id}}", - "relations": "{{.entity.relations}}" + "run_id": "{{.run.id}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/create-pagerduty-service.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/create-pagerduty-service.md index 67997e764..e8ce03a1e 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/create-pagerduty-service.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/create-pagerduty-service.md @@ -229,15 +229,13 @@ Create a new self service action using the following JSON configuration. "repo": "", "workflow": "create-a-service.yaml", "workflowInputs": { - "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", - "{{if (.inputs | has(\"name\")) then \"name\" else null end}}": "{{.inputs.\"name\"}}", - "{{if (.inputs | has(\"description\")) then \"description\" else null end}}": "{{.inputs.\"description\"}}", - "{{if (.inputs | has(\"escalation_policy\")) then \"escalation_policy\" else null end}}": "{{.inputs.\"escalation_policy\"}}", + "name": "{{.inputs.\"name\"}}", + "description": "{{.inputs.\"description\"}}", + "escalation_policy": "{{.inputs.\"escalation_policy\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", "entity": "{{.entity.identifier}}", - "run_id": "{{.run.id}}", - "relations": "{{.entity.relations}}" + "run_id": "{{.run.id}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/escalate-an-incident.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/escalate-an-incident.md index 5f18b53e6..a5b04cf2e 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/escalate-an-incident.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/escalate-an-incident.md @@ -223,15 +223,13 @@ Create a new self service action using the following JSON configuration. "repo": "", "workflow": "ecalate-an-incident.yaml", "workflowInputs": { - "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", - "{{if (.inputs | has(\"escalation_policy_id\")) then \"escalation_policy_id\" else null end}}": "{{.inputs.\"escalation_policy_id\"}}", - "{{if (.inputs | has(\"urgency\")) then \"urgency\" else null end}}": "{{.inputs.\"urgency\"}}", - "{{if (.inputs | has(\"from\")) then \"from\" else null end}}": "{{.inputs.\"from\"}}", + "escalation_policy_id": "{{.inputs.\"escalation_policy_id\"}}", + "urgency": "{{.inputs.\"urgency\"}}", + "from": "{{.inputs.\"from\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", "entity": "{{.entity.identifier}}", - "run_id": "{{.run.id}}", - "relations": "{{.entity.relations}}" + "run_id": "{{.run.id}}" } }, "reportWorkflowStatus": true diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/resolve-incident.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/resolve-incident.md index bc3f09861..c7ab8fbb4 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/resolve-incident.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/resolve-incident.md @@ -170,12 +170,11 @@ Create a new self service action using the following JSON configuration. }, "invocationMethod": { "type": "GITHUB", - "org": "GITHUB_ORG", - "repo": "GITHUB_REPO", + "org": "", + "repo": "", "workflow": "resolve-incident.yaml", "workflowInputs": { - "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", - "{{if (.inputs | has(\"from\")) then \"from\" else null end}}": "{{.inputs.\"from\"}}", + "from": "{{.inputs.\"from\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", "entity": "{{.entity.identifier}}", diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/trigger-pagerduty-incident.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/trigger-pagerduty-incident.md index d117eeabc..037a311a6 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/trigger-pagerduty-incident.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/trigger-pagerduty-incident.md @@ -250,12 +250,11 @@ Create a new self service action using the following JSON configuration. "repo": "", "workflow": "trigger-pagerduty-incident.yaml", "workflowInputs": { - "{{if (.inputs | has(\"ref\")) then \"ref\" else null end}}": "{{.inputs.\"ref\"}}", - "{{if (.inputs | has(\"summary\")) then \"summary\" else null end}}": "{{.inputs.\"summary\"}}", - "{{if (.inputs | has(\"source\")) then \"source\" else null end}}": "{{.inputs.\"source\"}}", - "{{if (.inputs | has(\"severity\")) then \"severity\" else null end}}": "{{.inputs.\"severity\"}}", - "{{if (.inputs | has(\"event_action\")) then \"event_action\" else null end}}": "{{.inputs.\"event_action\"}}", - "{{if (.inputs | has(\"routing_key\")) then \"routing_key\" else null end}}": "{{.inputs.\"routing_key\"}}", + "summary": "{{.inputs.\"summary\"}}", + "source": "{{.inputs.\"source\"}}", + "severity": "{{.inputs.\"severity\"}}", + "event_action": "{{.inputs.\"event_action\"}}", + "routing_key": "{{.inputs.\"routing_key\"}}", "port_context": { "blueprint": "{{.action.blueprint}}", "entity": "{{.entity.identifier}}", From b2f7779470612c36e4ef9756ecb49eaeb761db5c Mon Sep 17 00:00:00 2001 From: mkarmah Date: Mon, 20 May 2024 10:47:12 +0000 Subject: [PATCH 3/4] updated workflow inputs --- .../examples/PagerDuty/change-pagerduty-incident-owner.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md index 8038615ab..e8952bba8 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-pagerduty-incident-owner.md @@ -290,7 +290,6 @@ Create a new self service action using the following JSON configuration. "repo": "", "workflow": "change-incident-owner.yaml", "workflowInputs": { - "inputs": "{{.inputs.\"ref\"}}", "new_owner": "{{.inputs.\"new_owner\"}}", "from": "{{.inputs.\"from\"}}", "port_context": { From 3676cbb974cd2452751466dedff57bf741dec73f Mon Sep 17 00:00:00 2001 From: Michael Kofi Armah Date: Thu, 23 May 2024 14:50:45 +0000 Subject: [PATCH 4/4] Update change-on-call-user.md --- .../github-workflow/examples/PagerDuty/change-on-call-user.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md index 8ba5cd968..d4c7bbed8 100644 --- a/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md +++ b/docs/create-self-service-experiences/setup-backend/github-workflow/examples/PagerDuty/change-on-call-user.md @@ -249,8 +249,8 @@ Create a new self service action using the following JSON configuration. }, "invocationMethod": { "type": "GITHUB", - "org": "mk-armah", - "repo": "jira-actions", + "org": "", + "repo": "", "workflow": "change-on-call-user.yaml", "workflowInputs": { "start_time": "{{.inputs.\"start_time\"}}",