{"id":17744,"date":"2016-06-13T09:50:30","date_gmt":"2016-06-13T09:50:30","guid":{"rendered":"http:\/\/apidocs.kore.com\/?post_type=docs&amp;p=2618"},"modified":"2016-06-13T09:50:30","modified_gmt":"2016-06-13T09:50:30","slug":"integrating-with-mecurial","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-store\/adding-bots\/integrating-with-mecurial\/","title":{"rendered":"Adding a Mercurial Bot"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>Kore.ai provides integration for a built-in <em>Mercurial<\/em>\u00a0Bot\u00a0that you can use to display\u00a0message notifications and execute tasks directly\u00a0from the\u00a0Kore.ai application. To use the <em>Mercurial<\/em>\u00a0Bot, you just need to add the Bot to your Kore.ai account, and then configure the settings for the Bot, such as authentication to access <em>Mercurial<\/em>, and the\u00a0notification messages that you want. This topic describes the <em>Mercurial\u00a0<\/em>built-in Bot\u00a0for Kore.ai.\u00a0For more information about other Kore.ai Bots, see <a style=\"line-height: 1.42857;background-color: #ffffff\" href=\"\/docs\/bots\/what-are-kore-bots\/addingbots\/\">Adding Bots<\/a>.<\/p>\n<h1><span class=\"ez-toc-section\" id=\"About_the_Koreai_Bot_for_Mercurial\"><span class=\"wysiwyg-font-size-x-large\">About the Kore.ai Bot for\u00a0Mercurial<\/span><\/span><\/h1>\n<p><img decoding=\"async\" class=\"logo2 alignleft\" src=\"\/wp-content\/uploads\/sites\/35\/DIYMercurialLogo-1.png\" alt=\"DIYMercurialLogo\" \/><em>Mercurial<\/em>\u00a0is\u00a0a cross-platform, distributed revision control tool for software developers.<\/p>\n<table border=\"0\" width=\"645\">\n<tbody>\n<tr>\n<td><strong>Integration Type<\/strong><\/td>\n<td><strong>Webhook<\/strong> &#8211; Connect to this Bot using a webhook integration where the web application pushes\u00a0message notifications in near real time.<\/td>\n<\/tr>\n<tr>\n<td><strong>Category<\/strong><\/td>\n<td><strong>Developer Tools<\/strong>\u00a0&#8211; This Bot is available in the Kore.ai application in the\u00a0<strong>Developer Tools\u00a0<\/strong>category.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1><span class=\"ez-toc-section\" id=\"Configuring_Mercurial\"><a id=\"webhook\"><\/a><span class=\"wysiwyg-font-size-x-large\">Configuring Mercurial<\/span><\/span><\/h1>\n<p>To configure a <em>Mercurial<\/em> webhook for Kore.ai, you must have a <em>Mercurial<\/em>\u00a0account with administrator access as well as API access to configure a webhook. If you don&#8217;t, you&#8217;ll need to contact the\u00a0<em>Mercurial<\/em>\u00a0system administrator for\u00a0your company. For more information, see <a href=\"https:\/\/www.mercurial-scm.org\/wiki\/Tutorial\" target=\"_blank\" rel=\"noopener noreferrer\">A Tutorial on Using Mercurial<\/a>\u00a0in the <em>Mercurial<\/em> documentation.<br \/>\nTo get started configuring the webhook in <em>Mercurial<\/em>, you&#8217;ll need the Kore.ai webhook URL provided when you set up an alert in your Kore.ai account for each alert that you want to enable in\u00a0<em>Mercurial<\/em>.<br \/>\nThe webhook URL is account-specific and cannot be transferred to any other account. This means that if you configure a <em>Mercurial<\/em>\u00a0webhook using a test account, you will have to recreate the alert and get a new webhook URL to configure in <em>Mercurial<\/em>. The following URL is an example webhook URL.<br \/>\n<span style=\"color: #0000ff\">https:\/\/company.kore.com\/hooks\/c6089802f36250c179dcb1aa29afd24c<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Configuring_Webhook\"><span class=\"wysiwyg-font-size-large\">Configuring Webhook<\/span><\/span><\/h2>\n<p>This procedure describes the steps in <em>Mercurial<\/em>\u00a0to configure a webhook using a Kore.ai webhook URL endpoint.<br \/>\nTo complete\u00a0this procedure, you must download the <em><span style=\"color: #0000ff\">kore-hook-script.py<\/span><\/em> file, save it to your<em>Mercurial<\/em> repository, and then modify the file with the Kore.ai webhook URL. After you add the file, you must update the existing <em><span style=\"color: #0000ff\">hgrc<\/span><\/em> file in the same directory of\u00a0your repository to define the events that trigger alerts.<\/p>\n<ol>\n<li>Download the <em><span style=\"color: #0000ff\">kore-hook-script.py<\/span><\/em>\u00a0file using the link at the bottom of this page in the<strong>Article Attachments<\/strong> section, and then save the file to the <em>Mercurial<\/em> repository in the root of the \u00a0<span style=\"color: #0000ff\">&lt;<strong><em>MyRepo<\/em><\/strong>&gt;\/.hg\/<\/span>\u00a0directory for the repository that you want to add the webhook to.<\/li>\n<li>In a text editor of your choice, open the <span style=\"color: #0000ff\">kore-hook-script.py<\/span>\u00a0file, and then set the property for the Kore.ai webhook URL by modifying the following line:<br \/>\n<blockquote><p>\n<span style=\"color: #0000ff\">url = &#8220;https:\/\/app.kore.com\/hooks\/id&#8221;<\/span>\n<\/p><\/blockquote>\n<p class=\"p1\"><span class=\"s1\">with your Kore.ai webhook URL, and then <strong>Save<\/strong>\u00a0the\u00a0file.<\/span><\/p>\n<\/li>\n<li>In the\u00a0<span style=\"color: #0000ff\">&lt;<strong><em>MyRepo<\/em><\/strong>&gt;\/.hg\/<\/span>\u00a0directory, open the <em><span style=\"color: #0000ff\">hgrc<\/span><\/em> file in a text editor, and then add the following code that defines the triggers for alert notifications sent to your Kore.ai account.<span style=\"color: #0000ff\">commit = python:.hg\/kore-hook-script.py:commit<\/span><br \/>\n<span style=\"color: #0000ff\">\u00a0 \u00a0 \u00a0 \u00a0incoming = python:.hg\/kore-hook-script.py:incoming<\/span><br \/>\n<span style=\"color: #0000ff\">\u00a0 \u00a0 \u00a0 \u00a0outgoing = python:.hg\/kore-hook-script.py:outgoing<\/span><br \/>\n<span style=\"color: #0000ff\">\u00a0 \u00a0 \u00a0 \u00a0tag = python:.hg\/kore-hook-script.py:tag<\/span><br \/>\n<span style=\"color: #0000ff\">\u00a0 \u00a0 \u00a0 \u00a0changegroup = python:.hg\/kore-hook-script.py:changegroup<\/span><br \/>\n<strong><span style=\"color: #0000ff\">\u00a0 \u00a0 \u00a0 \u00a0update = python:.hg\/kore-hook-script.py:update<\/span><\/strong><\/li>\n<li><strong>Save<\/strong> the\u00a0file and commit changes to the repository.<\/li>\n<\/ol>\n<p>For more information, see <a href=\"http:\/\/hgbook.red-bean.com\/read\/handling-repository-events-with-hooks.html\" target=\"_blank\" rel=\"noopener noreferrer\">Handling repository events with hooks<\/a> in the <em>Mercurial: The Definitive Guide<\/em>.<br \/>\nYou can setup message notifications to your Kore.ai account using a <em>Mercurial<\/em>\u00a0webhook. Click\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"inline alignnone\" src=\"\/wp-content\/uploads\/sites\/35\/newtask.png\" alt=\"\" width=\"30\" height=\"34\" \/>, click <strong>Get notified when&#8230;<\/strong>, click <strong>Repository Updates<\/strong>, and then\u00a0in\u00a0the <strong>Setup Task\u00a0<\/strong>dialog:<\/p>\n<ul>\n<li>click the <strong>Activate<\/strong> button to generate a Webhook URL.<\/li>\n<li>copy and save the URL, or click <strong>Email Instructions<\/strong> to send the URL to an email account. For more information, see <a href=\"\/docs\/bots\/about-kore-bots\/addingbots\/integrating-with-mecurial\/#webhook\">Configuring Mercurial\u00a0Webhooks<\/a>.<\/li>\n<li>optionally customize the <strong>Task Name\u00a0<\/strong><\/li>\n<li>optionally customize the <strong>Short Description<\/strong><\/li>\n<li>enable or disable <strong>Mute task notifications<\/strong>.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Article_Attachments\"><span class=\"wysiwyg-font-size-large\">Article Attachments<\/span><\/span><\/h3>\n<div class=\"article-attachments\">\n<ul class=\"attachments\">\n<li><a href=\"https:\/\/support.kore.com\/hc\/en-us\/article_attachments\/203427767\/kore-hook-script.py\" target=\"_blank\" rel=\"noopener noreferrer\">kore-hook-script.py<\/a> (3 KB)<\/li>\n<\/ul>\n<\/div>\n<h1><span class=\"ez-toc-section\" id=\"Next_Steps\"><em><span class=\"wysiwyg-font-size-x-large\">Next Steps<\/span><\/em><\/span><\/h1>\n<p>After the webhook is configured in <em>Mercurial<\/em>, when any of the defined events occur in <em>Mercurial<\/em>, a message is displayed on the <strong>Bots<\/strong> tab in the <strong>Messages<\/strong> section for the Kore.ai account.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"Kore.ai provides integration for a built-in Mercurial\u00a0Bot\u00a0that you can use to display\u00a0message notifications and execute tasks directly\u00a0from the\u00a0Kore.ai application. To use the Mercurial\u00a0Bot, you just need to add the Bot to your Kore.ai account, and then configure the settings for the Bot, such as authentication to access Mercurial, and the\u00a0notification messages that you want. This...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[176],"tags":[],"class_list":["post-17744","post","type-post","status-publish","format-standard","hentry","category-adding-bots"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/17744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=17744"}],"version-history":[{"count":0,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/17744\/revisions"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=17744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=17744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=17744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}