Request Token URL | https://accounts.zoho.com/oauth/v2/auth?scope=ZohoBugTracker.portals.READ,ZohoBugTracker.projects.READ,ZohoBugTracker.bugs.READ,ZohoBugTracker.bugs.READ&access_type=offline |
Access Token URL | https://accounts.zoho.com/oauth/v2/token |
Refresh Token URL | https://accounts.zoho.com/oauth/v2/token |
Scopes | ZohoBugTracker.portals.READ,ZohoBugTracker.projects.READ,ZohoBugTracker.bugs.READ,ZohoBugTracker.bugs.READ |
Connector API Name | Method type | URL |
Get Portals | GET | https://bugtracker.zoho.com/restapi/portals/ |
Get Projects | GET | https://bugtracker.zoho.com/restapi/portal/${portalid}/projects/ |
Get Bugs | GET | https://bugtracker.zoho.com/restapi/portal/${portalid}/projects/${projectid}/bugs/ |
Util={}; var portalidvalue; var projectidvalue; //Subscribe to the EmbeddedApp onPageLoad event before initializing the widget ZOHO.embeddedApp.on("PageLoad",function(data) { var data = { } //Invoking the connector API to get the user's portal IDs and populate them in a select list ZOHO.CRM.CONNECTOR.invokeAPI("xxx.bugtracker.getportals",data) .then(function(dataa){ response = dataa.response; responsejson=JSON.parse(response); portal=responsejson.portals; for (i = 0; i < portal.length; i++) { portalid=portal[i].id_string; portalname=portal[i].name; var portallist = document.getElementById("portallist"); var option = document.createElement("OPTION"); option.innerHTML = portalname; option.value = portalid; portallist.appendChild(option); } }) //*Updating the value of the portal ID selected in the select list to the CRM variable Util.getvalues=function() { portalidvalue=document.getElementById("portallist").value; var variableMap = { "apiname": "xxx__Portal_ID", "value": portalidvalue}; ZOHO.CRM.CONNECTOR.invokeAPI("crm.set", variableMap); } }) |
//Retrieving the deal record and fetching the deal name response = zoho.crm.getRecordById("Deals",deal.get("Deals.ID").toLong()); dealprojectid = response.get("xxx__Project_ID"); info dealprojectid; dynamic_map = Map(); portalid = zoho.crm.getOrgVariable("xxx__Portal_ID"); dynamic_map.put("portalid",portalid); //Invoking the Get Project API to fetch the project ID response1 = zoho.crm.invokeConnector("xxx.bugtracker.getprojects",dynamic_map); projectresponse = response1.get("response"); projectdata = projectresponse.get("projects"); finalresponse = ""; for each item in projectdata { projectid = item.get("id"); info projectid; if(dealprojectid == projectid) { dynamic_map = Map(); portalid = zoho.crm.getOrgVariable("xxx__Portal_ID"); dynamic_map.put("portalid",portalid); dynamic_map.put("projectid",projectid); // Invoking the Get Bugs API to fetch the bug-related data response2 = zoho.crm.invokeConnector("xxx.bugtracker.getbugs",dynamic_map); bugresponse = response2.get("response"); bugdata = bugresponse.get("bugs"); info bugdata; count = 1; if(bugdata != null) { recordsXmlStr = "<record>"; for each value in bugdata { status = value.get("status"); recordsXmlStr = recordsXmlStr + "<row no='" + count + "'>"; recordsXmlStr = recordsXmlStr + "<FL val='Title'>" + value.get("title") + "</FL>"; recordsXmlStr = recordsXmlStr + "<FL val='Assignee Name'>" + value.get("assignee_name") + "</FL>"; recordsXmlStr = recordsXmlStr + "<FL val='Reported Person'>" + value.get("reported_person") + "</FL>"; recordsXmlStr = recordsXmlStr + "<FL val='Reported Email'>" + value.get("reporter_email") + "</FL>"; recordsXmlStr = recordsXmlStr + "<FL val='Status Type'>" + status.get("type") + "</FL>"; recordsXmlStr = recordsXmlStr + "</row>"; count = count + 1; } recordsXmlStr = recordsXmlStr + "</record>"; finalresponse = finalresponse + recordsXmlStr; } else { finalresponse = finalresponse + "<error>=><message>No bugs associated with this project.</message></error>"; } } } return finalresponse; |
Writer is a powerful online word processor, designed for collaborative work.