ansible / instruqt

Self-paced instruqt Training material
71 stars 60 forks source link

New servicenow issue: attach-problem (Sandbox id: dk3cryfrezl3) #490

Open matthewdormer opened 1 year ago

matthewdormer commented 1 year ago

Creating a problem failed to connect the incident but still created the problem. `Employee SKU logo

[Dashboard](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/home)
[Jobs](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/jobs)
[Schedules](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/schedules)
[Activity Stream](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/activity_stream)
[Workflow Approvals](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/workflow_approvals)

[Templates](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/templates)
[Credentials](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/credentials)
[Projects](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/projects)
[Inventories](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/inventories)
[Hosts](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/hosts)

[Organizations](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/organizations)
[Users](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/users)
[Teams](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/teams)

    [Credential Types](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/credential_types)
    [Applications](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/applications)
    [Execution Environments](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/execution_environments)

[Jobs](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/jobs)

[6 - 2 - Attach problem (problem-attach.yml)](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/jobs/playbook/6)

Output

[Back to Jobs](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/jobs)
[Details](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/jobs/playbook/6/details)
[Output](https://controller-443-dk3cryfrezl3.env.play.instruqt.com/#/jobs/playbook/6/output)

2 - Attach problem (problem-attach.yml) Successful Plays 1 Tasks 7 Hosts 1 Elapsed 00:00:14 Default alert:Events processing complete. TASK [query incident number and creation time] * ok: [localhost] => (item={'parent': '', 'made_sla': 'true', 'caused_by': '', 'watch_list': '', 'upon_reject': 'cancel', 'sys_updated_on': '2023-08-16 23:57:48', 'child_incidents': '0', 'origin_table': '', 'task_effective_number': 'INC0013013', 'approval_history': '', 'skills': '', 'number': 'INC0013013', 'resolved_by': '', 'sys_updated_by': 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER', 'opened_by': '6ba3f9cc8770b9105d60da083cbb35f0', 'user_input': '', 'sys_created_on': '2023-08-16 23:34:10', 'sys_domain': 'global', 'state': 'in_progress', 'route_reason': '', 'sys_created_by': 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER', 'knowledge': 'false', 'order': '', 'calendar_stc': '', 'closed_at': '', 'cmdb_ci': '', 'contract': '', 'impact': 'low', 'active': 'true', 'work_notes_list': '', 'business_service': '', 'business_impact': '', 'priority': '5', 'sys_domain_path': '/', 'rfc': '', 'time_worked': '', 'expected_start': '', 'opened_at': '2023-08-16 23:34:10', 'business_duration': '', 'group_list': '', 'work_end': '', 'caller_id': '6ba3f9cc8770b9105d60da083cbb35f0', 'reopened_time': '', 'resolved_at': '', 'approval_set': '', 'subcategory': '', 'work_notes': '', 'universal_request': '', 'short_description': 'User created a new incident using Ansible Automation Platform', 'close_code': '', 'correlation_display': '', 'work_start': '', 'assignment_group': '', 'additional_assignee_list': '', 'business_stc': '', 'cause': '', 'description': 'User ** successfully created a new incident!', 'origin_id': '', 'calendar_duration': '', 'close_notes': '', 'notify': '1', 'service_offering': '', 'sys_class_name': 'incident', 'closed_by': '', 'follow_up': '', 'parent_incident': '', 'sys_id': '87d439041bb0b910b76a0d0fdc4bcb88', 'contact_type': 'email', 'reopened_by': '', 'incident_state': '2', 'urgency': 'low', 'problem_id': 'PRB0041042', 'company': '', 'reassignment_count': '0', 'activity_due': '', 'assigned_to': '', 'severity': '3', 'comments': '', 'approval': 'not requested', 'sla_due': '', 'comments_and_work_notes': '', 'due_date': '', 'sys_mod_count': '1', 'reopen_count': '0', 'sys_tags': '', 'escalation': '', 'upon_approval': 'proceed', 'correlation_id': '', 'location': '', 'category': 'inquiry', 'attachments': []}) TASK [Create a problem from incident] ** [WARNING]: Encountered unknown value 1 while mapping field state. [WARNING]: Encountered unknown value 1 while mapping field problem_state. changed: [localhost] TASK [Assign a problem to a user for assessment] * changed: [localhost] TASK [Update incident status now that problem has been created] **** changed: [localhost] => (item={'number': 'INC0013013', 'opened_at': '2023-08-16 23:34:10'}) TASK [debug] ***`

IPvSean commented 1 year ago

Hey @cloin can you take a look?

SapphicFire commented 1 year ago

Hey folks, was about to raise this one but I see you've got this covered here. The issue with the problem backlink is that you're using problem.record.number on line 44 of problem-attach.yml. It's setting a value, just not a reference

SapphicFire commented 1 year ago

Also fyi this is a duplicate of #417

cloin commented 7 months ago

Updating from problem.record.number to problem.record.sys_id properly links the two records and allows one to see the incident from the problem record but not the problem record from the incident. I think the related records on the incident is looking for problems where the incident record is the parent which is not the case here as the problem was created independent of the incident.