{ "info": { "_postman_id": "5bf148cf-4d0a-42c9-9e6a-f85188f8f817", "name": "ProfessorM Sample Data - Advanced Workflow", "description": "See https://github.com/sugarcrm/school for more information. Note: Advanced Workflow is exclusive to Enterprise and Ultimate editions of Sugar 7.6.x and later", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Authenticate", "item": [ { "name": "Authenticate", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "var jsonData = JSON.parse(responseBody);", "var access_token = jsonData.access_token;", "", "tests[\"Successful POST request\"] = responseCode.code === 200;", "tests[\"access_token exists\"] = access_token !== null || access_token !== \"\";", "", "postman.setEnvironmentVariable(\"access_token\", access_token);", "" ] } } ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"grant_type\":\"password\",\n \"client_id\":\"sugar\",\n \"client_secret\":\"\",\n \"username\":\"{{username}}\",\n \"password\":\"{{password}}\",\n \"platform\":\"profm_import\"\n}" }, "url": { "raw": "{{url}}{{rest_endpoint}}/oauth2/token", "host": [ "{{url}}{{rest_endpoint}}" ], "path": [ "oauth2", "token" ] } }, "response": [] }, { "name": "Public Metadata", "event": [ { "listen": "test", "script": { "id": "68a8d9d1-5277-476b-99a5-cc7f97efa3af", "exec": [ "var jsonData = JSON.parse(responseBody);", "", "tests[\"Successful GET request\"] = responseCode.code === 200;", "pm.globals.set(\"idmModeEnabled\", jsonData.config.idmModeEnabled);", "" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}{{rest_endpoint}}/metadata/public", "host": [ "{{url}}{{rest_endpoint}}" ], "path": [ "metadata", "public" ] }, "description": "A call to get the public metadata. This will be initially used to determine if IDM is enabled." }, "response": [] } ] }, { "name": "Create Admissions Advisors", "item": [ { "name": "Create Admissions Advisor Matthew", "event": [ { "listen": "test", "script": { "id": "b1e9741c-a534-4bff-a31d-931324771f1d", "exec": [ "var jsonData = JSON.parse(responseBody);", "var idOfAdmissionsAdvisor = jsonData.id;", "", "if (pm.globals.get(\"idmModeEnabled\")) {", " tests[\"Successful POST request\"] = responseCode.code === 200;", " tests[\"id is correct\"] = \"matthew-id\" === idOfAdmissionsAdvisor;", " tests[\"user_name is correct\"] = \"matthew\" === jsonData.user_name;", "} else {", " tests[\"IDM not enabled\"] = pm.globals.get(\"idmModeEnabled\") === false;", "}" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "OAuth-Token", "value": "{{access_token}}" } ], "body": { "mode": "raw", "raw": "{\n\t\"first_name\":\"Matthew\",\n\t\"last_name\":\"Aysman\",\n\t\"user_name\":\"matthew\",\n\t\"employee_status\":\"Active\",\n\t\"status\":\"Active\",\n\t\"UserType\":\"RegularUser\",\n\t\"id\":\"matthew-id\"\n}" }, "url": { "raw": "{{url}}{{rest_endpoint}}/Users", "host": [ "{{url}}{{rest_endpoint}}" ], "path": [ "Users" ] } }, "response": [] }, { "name": "Create Admissions Advisor Ackburr", "event": [ { "listen": "test", "script": { "id": "d90b0950-0d7f-415b-9422-97f6c6b17063", "exec": [ "var jsonData = JSON.parse(responseBody);", "var idOfAdmissionsAdvisor = jsonData.id;", "", "if (pm.globals.get(\"idmModeEnabled\")) {", " tests[\"Successful POST request\"] = responseCode.code === 200;", " tests[\"id is correct\"] = \"ackburr-id\" === idOfAdmissionsAdvisor;", " tests[\"user_name is correct\"] = \"ackburr\" === jsonData.user_name;", "} else {", " tests[\"IDM not enabled\"] = pm.globals.get(\"idmModeEnabled\") === false;", "}" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "OAuth-Token", "value": "{{access_token}}" } ], "body": { "mode": "raw", "raw": "{\n\t\"first_name\":\"Ackburr\",\n\t\"last_name\":\"Bahabialila\",\n\t\"user_name\":\"ackburr\",\n\t\"employee_status\":\"Active\",\n\t\"status\":\"Active\",\n\t\"UserType\":\"RegularUser\",\n\t\"id\":\"ackburr-id\"\n}" }, "url": { "raw": "{{url}}{{rest_endpoint}}/Users", "host": [ "{{url}}{{rest_endpoint}}" ], "path": [ "Users" ] } }, "response": [] } ] }, { "name": "Create Process Definitions", "item": [ { "name": "Import Application Routing Process Definition", "event": [ { "listen": "test", "script": { "id": "6a27da1b-360c-434d-ad47-4e6c683fb7d7", "type": "text/javascript", "exec": [ "var jsonData = JSON.parse(responseBody);", "var idOfProcessDefinition = jsonData.project_import.id;", "", "tests[\"Successful POST request\"] = responseCode.code === 200;", "tests[\"id exists\"] = idOfProcessDefinition !== null || idOfProcessDefinition !== \"\";", "tests[\"successful project import\"] = true === jsonData.project_import.success;", "tests[\"no br warnings\"] = false === jsonData.project_import.br_warning;", "tests[\"no et warnings\"] = false === jsonData.project_import.et_warning;", "", "postman.setEnvironmentVariable(\"ApplicationRoutingProcessDefinitionId\", idOfProcessDefinition);" ] } } ], "request": { "method": "POST", "header": [ { "key": "OAuth-Token", "value": "{{access_token}}" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "Application_Routing.bpm" }, { "key": "selectedIds", "value": "[\"7399b17c-9996-11e8-84ef-7200080cd7d0\"]", "type": "text" } ] }, "url": { "raw": "{{url}}{{rest_endpoint}}/pmse_Project/file/project_import", "host": [ "{{url}}{{rest_endpoint}}" ], "path": [ "pmse_Project", "file", "project_import" ] } }, "response": [] }, { "name": "Enable Application Routing Process Definition", "event": [ { "listen": "test", "script": { "id": "2a57fe3a-f067-4b25-b54a-9d0ffd21e888", "type": "text/javascript", "exec": [ "var jsonData = JSON.parse(responseBody);", "var idOfProcessDefinition = jsonData.id;", "", "tests[\"Successful POST request\"] = responseCode.code === 200;", "tests[\"id exists\"] = idOfProcessDefinition !== null || idOfProcessDefinition !== \"\";", "tests[\"project status is active\"] = \"ACTIVE\" === jsonData.prj_status;", "" ] } } ], "request": { "method": "PUT", "header": [ { "key": "OAuth-Token", "value": "{{access_token}}" } ], "body": { "mode": "raw", "raw": "{\"prj_status\": \"ACTIVE\"}" }, "url": { "raw": "{{url}}{{rest_endpoint}}/pmse_Project/{{ApplicationRoutingProcessDefinitionId}}", "host": [ "{{url}}{{rest_endpoint}}" ], "path": [ "pmse_Project", "{{ApplicationRoutingProcessDefinitionId}}" ] } }, "response": [] } ] } ] }