Create ticket wizard should contain few sub pages to collect information required.
Each section describes how to collect diffrent information to create the POST request to Task
On Wello, this is a special type of project that is called Location. Each location is linked to a specific address. A location is in fact a row of entity 'Project' but with a specific equipment_family_id.
To get all the location.
~/api/ProjectView?$select=id,name,db_address_street,db_address_street_number,db_address_city,db_address_zip&$filter=equipment_family_id+eq+EDC4D105-71A4-474E-9CC7-8DB5297CF845Sample Response :
{
"@odata.context":"https://v1servicedeskapi.wello.solutions/api/$metadata#ProjectView(id,name,db_address_street,db_address_street_number,db_address_city,db_address_zip)","value":
[
{
"db_address_street": "Test Street",
"db_address_street_number": "0",
"db_address_zip": "TEST ZIP",
"db_address_city": "Test City",
"id": "1ed06d15-dac6-4051-8992-185bdae327a0",
"name": "sample string name"
}
]
}
This is done by doing a call on endpoint DbFileView, linked to the project_id previously selected.
To get all the location.
~/api/DbFileView?$filter=db_table_name+eq+'project'+and+id_in_table+eq+%Your_Location.id%Sample Response :
Allow user to enter ticket location.
Entered Location will be inserted into Subject of the task. Eg : Subject = Project/Installation Name + Location Entered
User will select Installation or Equipment he needed for this ticket. Display installations that belongs to that location, by filter on projectview.
To list down installations use below Url
If the user selected a location
~/api/ProjectView?$filter=root_parent_id+eq+{location_id}
~/api/ProjectView?$filter=company_id+eq+{company_id}+and+is_mobile_installation+eq+true
{
"@odata.context":"https://servicedeskapi.wello.solutions/api/$metadata#ProjectView","value":
[
{
"id": "5fa707d2-ba9c-4a97-aceb-8780be441de2",
"id2": 71,
"reference_back_office": "",
"_parent_id": "00000000-0000-0000-0000-000000000000",
"project_status_id": "5068bcac-b6f3-49f2-9529-bae3b3b6c556",
"project_status_name": "TESTXXXX default",
"project_status_is_closed": false,
"name": "APITEST0001 Installation",
"description": "",
"equipment_family_id": "7105067c-4a2a-4b44-bd11-efe9bc115e16",
"equipment_family_name": "TESTXXXX default",
"equipment_model_id": "27b44515-1b78-437b-be3c-34cf93e5aced",
"equipment_model_name": "TESTXXXX default",
"equipment_brand_id": "3f1c2f75-44bc-49ab-b42f-51011b1ad125",
"equipment_brand_name": "TESTXXXX Default",
"company_id": "e6eb5764-7247-485e-a0b8-ec59e4afa2e5",
"company_code": "",
"company_name": "APITEST0001 Company",
"company_sales_organization_id": "4d98c81b-0fab-4a2a-b1d6-f3bcc6e2ab61",
"db_address_street": "APITEST0001 Address ",
"db_address_street_number": "",
"db_address_zip": "APITEST0001 Zip",
"db_address_city": "APITEST0001 City",
"db_address_country_code": "",
"db_address_country_name": "",
"db_address_phone": "",
"nb_jobs_planned": 1,
"nb_jobs_tobeplanned": 0,
"nb_jobs_waitingfurtheraction": 0,
"company_db_address_id": "00000000-0000-0000-0000-000000000000",
"has_child": false,
"db_address_id": "25e9c126-f155-4ba9-98d4-a82e6fe578b8",
"location": "",
"contact_id": "2ae200a8-c5f1-4860-a861-aeebf7fb1025",
"serial_number": "APITEST0001 Installation Serial No",
"barcode": "",
"date_start_production": "1980-01-01T00:00:00.000Z",
"date_create": "2014-10-10T12:47:07.757Z",
"date_update": "2014-10-10T12:54:21.250Z",
"nb_open_jobs": 1,
"date_next_job": "2014-10-10T13:30:00.000Z",
"date_last_job": "1980-01-01T00:00:00.000Z",
"warranty_date_until": "1980-01-01T00:00:00.000Z",
"date_built": "1980-01-01T00:00:00.000Z",
"shutdown_consequence": ""
}
]
}
User should select Ticket Type & Ticket Severity from a dropdown.
To fill Ticket Type dropdown use below Url
~/api/TaskType?$select=id,name&$orderby=is_default,sequence
{
"@odata.context":"https://servicedeskapi.wello.solutions/api/$metadata#TaskType(id,name)","value":[
{
"id":"21d3a15d-a149-4685-8591-9a9cbeb3e755","name":"APITEST 0001"
},{
"id":"653bcb13-846b-4008-a84d-3630eb92be4d","name":"TEST SDAPI in English"
}
]
}
api/TaskPriority?$select=id,name&$orderby=is_default,sequence
{
"@odata.context":"https://servicedeskapi.wello.solutions/api/$metadata#TaskPriority(id,name)","value":[
{
"id":"87d8216e-e753-402d-a31e-a512862e6e4f","name":"High SD"
}
]
}
Subject of the ticket & Remark/Issue of the ticket.
User can enter his preferred date to start this ticket. This date should be start_date when creating Task on Wello Service desk API.
Allow user to attach file into his ticket.
File can be posted to Wello API DbFile only after Task (Ticket) is been created, because you will need created Task.ID to POST DBFile.
File can be saved locally inside a Javascript variable for this time.
At this screen allow user to review his data again and go back and modify them if needed.
Once user reviewed his data , he can click Send or Create button which will perform a POST to ~/api/Task of Wello Service Desk API.
Request :
POST ~/api/Task
{
"db_address_id": "25e9c126-f155-4ba9-98d4-a82e6fe578b8",
"task_type_id": "653bcb13-846b-4008-a84d-3630eb92be4d",
"task_priority_id": "87d8216e-e753-402d-a31e-a512862e6e4f",
"subject": "TEST SDAPI in English - APITEST0001 Installation - Your Location",
"remark": "Your Issue",
"date_start": "2015-10-19T07:41:36.685Z"
}
HTTP/1.1 201 Created
{
"@odata.context": "https://servicedeskapi.wello.solutions/api/$metadata#Task/$entity",
"id": "a6996e09-f77e-4245-a049-f8b93618f7d3",
"task_status_id": "00000000-0000-0000-0000-000000000000",
"db_address_id": "25e9c126-f155-4ba9-98d4-a82e6fe578b8",
"task_type_id": "653bcb13-846b-4008-a84d-3630eb92be4d",
"task_priority_id": "87d8216e-e753-402d-a31e-a512862e6e4f",
"subject": "TEST SDAPI in English - APITEST0001 Installation - Your Location",
"remark": "Your Issue",
"date_start": "2015-10-19T07:41:36.685Z",
"company_id": "d75fb242-491d-4ac2-971b-03316516be59",
"contact_id": "8b49fae9-cb95-41ed-9f28-a77955c84d18",
"to_db_table_id": "00000000-0000-0000-0000-000000000000",
"to_db_table_name": null,
"to_id_in_table": "00000000-0000-0000-0000-000000000000",
"customer_reference": "",
"date_create": "2015-10-21T14:10:33.927Z",
"due_date": "1980-01-01T00:00:00.000Z",
"date_closed": "1980-01-01T00:00:00.000Z",
"archived": false,
"date_assigned": "1980-01-01T00:00:00.000Z",
"date_suggested_by_company": "1980-01-01T00:00:00.000Z",
"id2": 3,
"reference_back_office": "",
"modified_dateutc": "2015-09-21T08:44:13.440Z"
}
Once we received successful reponse 201 from Wello Service desk API on Task Create.Grab created Task ID from Response. We can now Send our attachment to DbFile as a File POST
Request :
POST ~/api/dbfile/add/?db_table_id=448260E5-7A17-4381-A254-0B1D8FE53947&id_in_table={created_task_id}&description={user_description}
HTTP/1.1 201 Created