ansible/awx

Notification received after successful workflow execution should have schedule reference

Open

#7,285 opened on Jun 8, 2020

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Python (3,333 forks)batch import
component:apihelp wantedtype:enhancement

Repository metrics

Stars
 (13,071 stars)
PR merge metrics
 (Avg merge 24d 6h) (30 merged PRs in 30d)

Description

ISSUE TYPE
  • Feature Idea
SUMMARY

When we receive the notification after successful workflow execution, it should have schedule reference as well because it was triggered by the schedule

Below details received as notification. { "id": 10470, "name": "Ajit test workflow", "url": "https://towerhost/#/workflows/10470", "created_by": "awxadmin", "started": "2020-06-08T07:21:16.908279+00:00", "finished": "2020-06-08T07:21:37.150384+00:00", "status": "successful", "traceback": "", "body": "Workflow job summary:\n\n- node #3300 spawns job #10472, "Ajit Return Value", which finished with status successful.\n- node #3299 spawns job #10471, "Ajit Job Template - Create Directory", which finished with status successful." }, {'host_status_counts': {}, 'id': 10470, 'type': 'workflow_job', 'url': '/api/v2/workflow_jobs/10470/', 'created': datetime.datetime(2020, 6, 8, 7, 21, 15, 734597, tzinfo=), 'modified': datetime.datetime(2020, 6, 8, 7, 21, 37, 166299, tzinfo=), 'name': 'Ajit test workflow', 'description': '', 'limit': None, 'launch_type': 'relaunch', 'status': 'successful', 'failed': False, 'started': '2020-06-08T07:21:16.908279Z', 'finished': '2020-06-08T07:21:37.150384Z', 'elapsed': 20.242, 'job_explanation': '', 'allow_simultaneous': False, 'scm_branch': None, 'summary_fields': {'unified_job_template': {'id': 141, 'name': 'Ajit test workflow', 'description': '', 'unified_job_type': 'workflow_job'}, 'created_by': {'id': 1, 'username': 'awxadmin', 'first_name': '', 'last_name': ''}, 'labels': {'count': 0, 'results': []}}}

When I call the API to get the workflow details, it is showing the schedule object into "summary_fields". can it be added onto the notifications as well

Below data received through API { "id": 10467, "type": "workflow_job", "url": "/api/v2/workflow_jobs/10467/", "related": { "unified_job_template": "/api/v2/workflow_job_templates/141/", "schedule": "/api/v2/schedules/250/", "workflow_job_template": "/api/v2/workflow_job_templates/141/", "notifications": "/api/v2/workflow_jobs/10467/notifications/", "workflow_nodes": "/api/v2/workflow_jobs/10467/workflow_nodes/", "labels": "/api/v2/workflow_jobs/10467/labels/", "activity_stream": "/api/v2/workflow_jobs/10467/activity_stream/", "relaunch": "/api/v2/workflow_jobs/10467/relaunch/", "cancel": "/api/v2/workflow_jobs/10467/cancel/" }, "summary_fields": { "organization": { "id": 6, "name": "SDI", "description": "" }, "workflow_job_template": { "id": 141, "name": "Ajit test workflow", "description": "" }, "schedule": { "id": 250, "name": "AjitWFTest", "description": "every day for 1 time" }, "unified_job_template": { "id": 141, "name": "Ajit test workflow", "description": "", "unified_job_type": "workflow_job" }, "user_capabilities": { "delete": true, "start": true }, "labels": { "count": 0, "results": [] } }, "created": "2020-06-08T07:20:10.754313Z", "modified": "2020-06-08T07:20:11.933544Z", "name": "Ajit test workflow", "description": "", "unified_job_template": 141, "launch_type": "scheduled", "status": "successful", "failed": false, "started": "2020-06-08T07:20:11.933251Z", "finished": "2020-06-08T07:20:34.683411Z", "canceled_on": null, "elapsed": 22.75, "job_args": "", "job_cwd": "", "job_env": {}, "job_explanation": "", "result_traceback": "", "workflow_job_template": 141, "extra_vars": "{}", "allow_simultaneous": false, "job_template": null, "is_sliced_job": false, "inventory": null, "limit": null, "scm_branch": null, "webhook_service": "", "webhook_credential": null, "webhook_guid": "" }

Thanks in advance

Regards, Ajit

Contributor guide