Code reviews are critical, and they can get buried in conversations or lost when using multiple tools. With the
Cliq Platform's link handlers, let's transform shared Github pull request links into interactive, real-time code reviews on channels. Share PR links in any reviewer groups or channels to get approval or receive review comments instantly.
Pre-requisites:
Before beginning to script the code below, we must create a connection with Github. Once a connection is created and connected, you can use it in Deluge integration tasks and invoke URL scripts to access data from the required service.
Create a Github default connection with any unique name ( “githubforcliq” for this example) and the scopes - repo.
Refer to the below links to learn more:
Step 1: Create an extension and add a link handler
- After successfully logging into Cliq, hover over the top right corner and click on your profile. Then navigate to Bots & Tools > My Extensions.
- On the right side, click the Create Extension button.
- To learn more about extensions and their purposes, refer to the Introduction to Extensions.
- Create an extension using your preferred name. Please specify the following details: the extension name, a description (to help users understand the extension's purpose), and an image to identify it.
- Under the link handlers section, enter github.com to configure the extension to preview links for that domain.
- Bundle the newly created form function - addCommentPullRequest, as it is mandatory to include at least one component to an extension, and then click Create.
Step 2: Configuring the preview handler
- After creating an extension, a popup will appear that provides an overview, which includes information about the extension. It will also list the connectors, showing the components bundled with the extension and their associated app keys.
- Additionally, handlers will allow you to configure access, customize settings, and manage links within the extension.
- Navigate to handlers, scroll down, and under link handlers, hover over to preview handler.
- The Preview Handler expands a rich response when a URL is shared in a conversation. Click edit code and copy and paste the script below.
Script
- pullRequest_url = url;
- owner = pullRequest_url.getSuffix(".com/").getPrefix("/");
- pullRequest_ID = pullRequest_url.substring(pullRequest_url.lastIndexOf("/pull/") + 6);
- repositoryName = pullRequest_url.substring(pullRequest_url.indexOf("github.com/") + 11,pullRequest_url.lastIndexOf("/pull/"));
- // Fetch PR details from GitHub API
- getPRDetails = invokeurl
- [
- url :"https://api.github.com/repos/" + repositoryName + "/pulls/" + pullRequest_ID
- type :GET
- connection:"githubforcliq"
- ];
- // Parse API response
- pr_title = getPRDetails.get("title");
- pr_author = getPRDetails.get("user").get("login");
- changed_files = getPRDetails.get("changed_files");
- arguments = Map();
- arguments.put("pullRequest_ID",pullRequest_ID);
- arguments.put("repositoryName",repositoryName);
- arguments.put("owner",owner);
- arguments.put("pr_title",pr_title);
- arguments.put("pr_author",pr_author);
- arguments.put("changed_files",changed_files);
- // Build preview response
- response = {"title":"Pull Request -" + pr_title,"type":"link","provider_url":pullRequest_url,"faviconlink":"https://zoho.com/sites/default/files/cliq/images/githubmark.png","thumbnail_url":"https://zoho.com/sites/default/files/cliq/images/githubmark.png","fields":{"data":{{"label":"Author","value":pr_author},{"label":"Files Changed","value":changed_files}}},"actions":{{"hint":"Approve a pull request instantly","style":"+","label":"Approve","type":"button","params":arguments},{"hint":"Add review comments to the pull request","label":"Add a comment","type":"button","params":arguments}}};
- return response;
Step 3: Configuring the action handler
- We have refined the response of the pull request URL when it is shared in a Cliq conversation. Now, we need to define the actions to be performed when the buttons in the unfurled response are clicked.
- This can be configured in the action handler. To locate it, navigate to the extension handlers. Scroll down to find the link handlers section, then hover over to the action handler.
- The action handler executes actions when the buttons in the unfurled card are clicked. Click "Edit Code" and copy and paste the script below.
Script
- label = target.get("label");
- pullRequest_ID = target.get("params").get("pullRequest_ID");
- repositoryName = target.get("params").get("repositoryName");
- owner = target.get("params").get("owner");
- response = Map();
- if(label.equals("Approve"))
- {
- params = Map();
- params.put("event","APPROVE");
- headers = Map();
- headers.put("Content-Type","application/json");
- approvePullRequest = invokeurl
- [
- url :"https://api.github.com/repos/" + owner + "/" + repositoryName.getSuffix("/") + "/pulls/" + pullRequest_ID + "/reviews"
- type :POST
- parameters:params + ""
- headers:headers
- detailed:true
- connection:"githubforcliq"
- ];
- info approvePullRequest;
- responseCode = approvePullRequest.get("responseCode");
- if(responseCode == 200)
- {
- pull_request_url = approvePullRequest.get("responseText").get("pull_request_url");
- pr_title = target.get("params").get("pr_title");
- pr_author = target.get("params").get("pr_author");
- changed_files = target.get("params").get("changed_files");
- response = {"card":{"title":"✅ Pull Request Approved","theme":"modern-inline"},"buttons":{{"label":"View Pull Request","hint":"","type":"+","action":{"type":"open.url","data":{"web":pull_request_url}}}},"text":"*Pull Request* :" + pr_title + "\n*Author* : " + pr_author + "\n*Files changed*:" + changed_files};
- return response;
- }
- else
- {
- banner = {"text":"Pull request approval failed!","status":"failure","type":"banner"};
- return banner;
- }
- }
- else
- {
- return {"type":"form","title":"Add Review Comment","name":"addComment","button_label":"Add","inputs":{{"label":"Review Comment","name":"comment","placeholder":"Leave a note for the author or your team","min_length":"0","max_length":"500","mandatory":true,"type":"textarea"},{"name":"pullRequest_ID","value":pullRequest_ID,"type":"hidden"},{"name":"repositoryName","value":repositoryName,"type":"hidden"},{"name":"owner","value":owner,"type":"hidden"}},"action":{"type":"invoke.function","name":"addCommentPullRequest"}};
- }
- return Map();
Step 4: Handling the form submit handler to add comments to a pull request
- When clicking the "Add a comment" button, a form will be triggered to allow users to add comments in the specified multi-line input text field. This form should be submitted using the form functions in Cliq.
- To create this function, navigate to Bots & Tools > Functions. On the right side, click "Create Function" and name the function "addCommentPullRequest." Choose the Function Type as "Form."
- After that, click "Save & Edit Code" and paste the script provided below.
Script : addCommentPullRequest - Form Submit Handler
- response = Map();
- formValues = form.get("values");
- pullRequest_ID = formValues.get("pullRequest_ID");
- repositoryName = formValues.get("repositoryName");
- owner = formValues.get("owner");
- comment = formValues.get("comment");
- params = Map();
- params.put("body",comment);
- params.put("event","COMMENT");
- headers = Map();
- headers.put("Content-Type","application/json");
- addComment = invokeurl
- [
- url :"https://api.github.com/repos/" + owner + "/" + repositoryName.getSuffix("/") + "/pulls/" + pullRequest_ID + "/reviews"
- type :POST
- parameters:params + ""
- headers:headers
- detailed:true
- connection:"githubforcliq"
- ];
- info addComment;
- responseCode = addComment.get("responseCode");
- if(responseCode == 200)
- {
- banner = {"text":"Comment added to the pull request","status":"success","type":"banner"};
- return banner;
- }
- else
- {
- banner = {"text":"Unable to add review comments!","status":"failure","type":"banner"};
- return banner;
- }
- return Map();
Note :
You need to configure the app link to get a rich, unfurled response for the GitHub PR links posted in any chat. Refer to the link below to configure the unfurl link in Zoho Cliq.
🔄 Workflow explanation
With this custom solution, GitHub Pull Requests can be shared instantly in any chat, group, or channel to get them reviewed by designated reviewers or top collaborators of the repository.
💼 Business benefits
- Faster review cycles – Reduces turnaround time by bringing PRs directly into team conversations.
- Improved code quality – Promotes timely feedback from key collaborators and senior reviewers.
- Increased developer visibility – Ensures pull requests don’t go unnoticed or remain idle.
- Streamlined collaboration – Centralizes communication around code changes, reducing context-switching.
No more gaps between the coding lifecycle and collaboration. Implementing rich previews for GitHub pull requests speeds up the development process, leading to better visibility, quicker feedback, and more substantial code ownership.
We're here to help, so don't hesitate to reach out to support@zohocliq.com with any questions or if you need assistance in crafting even more tailored workflows.
Recent Topics
Follow-up emails via Workflow Automation not staying in the same thread
Dear Zoho Support Team, I am currently using Workflow Automation in Zoho Campaigns to send follow-up emails. In my test case, I noticed the following behavior: All emails in the automation have the same subject line. If the follow-up email is sent within
Client Script refuses to set an initial value in Subform field
I tried a very simple, 1 line client script to set a default value in a custom subform field when the "Add Row" button is clicked and the user is entering data. It does not work - can someone tell me why? ZDK documentation suggests this should be doable.
Archiving Contacts
How do I archive a list of contacts, or individual contacts?
How do I filter contacts by account parameters?
Need to filter a contact view according to account parameter, eg account type. Without this filter users are overwhelmed with irrelevant contacts. Workaround is to create a custom 'Contact Type' field but this unbearable duplicity as the information already
Send / Send & Close keyboard shortcuts
Hello! My team is so close to using Zoho Desk with just the keyboard. Keyboard shortcuts really help us to be more efficient -- saving a second or two over thousands of tickets adds up quickly. It seems like the keyboard shortcuts in Desk are only for
Zoho Social - Post Footer Templates
As a content creator I often want to include some information at the end of most posts. It would be great if there was an option to add pre-written footers, similar to the Hashtag Groups at the end of posts. For example, if there is an offer I'm running
Zoho Expense - The ability to add detail to a Trip during booking
As an admin, I would like the ability to add more detail to the approved Trips. At present a requestor can add flights, accommodation details and suggest their preferences. It would be great if the exact details of the trip could be added either by the
Simplified Call Logging
Our organization would like to start logging calls in our CRM; however, with 13 fields that can't be removed, our team is finding it extremely cumbersome. For our use case, we only need to record that a call happened theirfor would only need the following
Week date range in pivot table
Hello, I need to create a report that breakouts the data by week. I am using the pivot table report, and breaking out the date by week, however the date is displayed as 'Week 1 2014' format. Is there anyway to get the actual dates in there? ex. 1/6/2014-1/12/2014 Thanks,
Help Center IFrame Issue
I have had a working Help Center on my website using an iframe for a while. But now for some reason the sign in page gets a refused to connect error. Can someone please help. If I go to the url manually it works correclty
Staff rules
Hi! Do you people know what are the default staff rules when a new booking is created? We have two staff members in my team (me as the admin, and my employee). As we share the same services, I'm wondering how Zoho will pick the staff for new apointments.
Comment Templates
Is it possible to add a template option for comments? We have some agents in the process who's responses require a pre-formatted layout. It would be incredibly handy to have a template for them where they can insert the template and then add their responses
[ZohoDesk] Improve Status View with a new editeble kanban view
A kanban view with more information about the ticket and the contact who created the ticket would be valueble. I would like to edit the fields with the ones i like to see at one glance. Like in CRM where you can edit the canvas view, i would like to edit
Adding Markdown text using Zoho Desk API into the Knowledge Base
Hi Zoho Community members, We currently maintain the documentation of out company in its website. This documentation is written in markdown text format and we would like to add it in Zoho Knowledge Base. Do you know if there is REST API functionality
An Exclusive Session for Zoho Desk Users: AI in Zoho Desk
A Zoho Community Learning Initiative Hello everyone! This is an announcement for Zoho Desk users and anyone exploring Zoho Desk. With every nook and corner buzzing, "AI's here, AI's there," it's the right time for us to take a closer look at how the AI
Shared values: From classroom lessons to teaching moments in customer service
While the world observes Teachers’ Day on October 5, in India, we celebrate a month earlier, on September 5, to mark the birth anniversary of Dr. Sarvepalli Radhakrishnan, a great teacher, renowned scholar, educationist, and advocate for empowerment.
Export to excel stored amounts as text instead of numbers or accounting
Good Afternoon, We have a quarterly billing report that we generate from our Requests. It exports to excel. However if we need to add a formula (something as simple as a sum of the column), it doesn't read the dollar amounts because the export stores
Auto Capitalize First Letter of Words
Hi I am completely new to ZOHO and am trying to build a database. How can i make it when a address is entered into a form field like this: main st it automatically changes is to show: Main St Thank You
Update application by uploading an updated DS file
Is it possible? I have been working with AI on my desktop improving my application, and I have to keep copy pasting stuff... Would it be possible to import the DS file on top of an existing application to update the app accordingly?
Image Upload Field | Zoho Canvas
I'm working on making a custom view for one of our team's modules. It's an image upload field (Placement Photo) that would allow our sales reps to upload a picture of the house their working on. However, I don't see that field as a opinion when building
Create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM
How to create a list of customers who participated in specific Zoho Backstage events and send them an email via Zoho CRM? I was able to do a view in CRM based on customer that registered to an event, but I don't seems to be able to include the filter
Custom Button Disappearing in mobile view | Zoho CRM Canvas
I'm working in Zoho CRM Canvas to create a custom view for our sales team. One of the features I'm adding is a custom button that opens the leads address in another tab. I've had no issue with this in the desktop view, but in the mobile view the button
Zoho Desk blank page
1. Click Access zoho desk on https://www.zoho.com/desk/ 2. It redirects to https://desk.zoho.com/agent?action=CreatePortal and the page is blank. Edge browser Version 131.0.2903.112 (Official build) (arm64) on MacOS
Clearing Fields using MACROS?
How would I go about clearing a follow-up field date from my deals? Currently I cannot set the new value as an empty box.
I hate the new user UI with the bar on the left
How can I reverse this?
Constant color of a legend value
It would be nice if we can set a constant color/pattern to a value when creating a chart. We would often use the same value in different graph options and I always have to copy the color that we've set to a certain value from a previous graph to make
Office 365 and CRM mail integration: permission required
Has anyone run into this weird problem? My email server is Office 365. When I try to configure Zoho CRM to use this server, a Microsoft popup window opens requesting user and password. After entering that, I get a message in the Microsoft window saying
Field Not Updating in FSM Script - Service and Parts module.
Dear Team, I am reaching out regarding a script I have implemented in Zoho FSM to automate the calculation of the End of Service date based on the End of Sale date in the Service and Parts module. Overview of the script: Fetches the End_of_Sale__C and
Question regarding import of previous deals...
Good afternoon, I'm working on importing some older deal records from an external sheet into the CRM; however, when I manually click "Add New Deal" and enter the pertinent information, the deal isn't appearing when I look at the "Deals" bar on the account's
Client Script also planned for Zoho Desk?
Hello there, I modified something in Zoho CRM the other day and was amazed at the possibilities offered by the "Client Script" feature in conjunction with the ZDK. You can lock any fields on the screen, edit them, you can react to various events (field
One person/cell phone to manage multiple accounts
Hi. I have a personal Free account to keep my own domain/emails. Now I need to create a Business account to my company's own domain, but I have only one mobile phone number I use to everything. How do I do to manage this? Can I manage a Free domain and
Tracking KPIs, Goals etc in People
How are Zoho People users tracking employee targets in People? For example, my marketing assistant has a target of "Collect 10 new customer testimonials every month". I want to record attainment for this target on a monthly basis, then add it to their
Zoho Desk: Ticket Owner Agents vs Teams
Hi Zoho, We would like to explore the possibility of hiding the ‘Agents’ section within the Ticket Owner dropdown, so that we can fully utilise the ‘Teams’ dropdown when assigning tickets. This request comes from the fact that only certain agents and
CRM limit reached: only 2 subforms can be created
we recently stumbled upon a limit of 2 subforms per module. while we found a workaround on this occasion, only 2 subforms can be quite limiting in an enterprise setting. @Ishwarya SG I've read about imminent increase of other components (e.
Can not Use Attachment Button on Android Widget
this always pops up when I touch the attach button on android widget. going to settings, there is no storage permission to be enabled. if I open the app, and access the attach feature there, I can access my storage and upload normally.
Can I add Conditional merge tags on my Templates?
Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
Zoho Notebook Sync problem
I'm facing a problem with syncing of notebook on android app. It's not syncing. Sometimes it syncs after a day or two. I created some notes on web notebook but it's not syncing on mobile app. Please help!!!!
Kaizen #190 - Queries in Custom Related Lists
Hello everyone! Welcome back to another week of Kaizen! This week, we will discuss yet another interesting enhancement to Queries. As you all know, Queries allow you to dynamically retrieve data from CRM as well as third-party services directly within
Custom Fonts in Zoho CRM Template Builder
Hi, I am currently creating a new template for our quotes using the Zoho CRM template builder. However, I noticed that there is no option to add custom fonts to the template builder. It would greatly enhance the flexibility and branding capabilities if
Announcing new features in Trident for Mac (1.24.0)
Hello everyone! Trident for macOS (v.1.24.0) is here with interesting features and thoughtful enhancements to redefine the way you plan and manage your calendar events. Here's a quick look at what's new. Create calendar events from emails. In addition
Next Page