{"id":302121,"date":"2020-04-18T15:00:38","date_gmt":"2020-04-18T15:00:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302121"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302121","title":{"rendered":"\u0427\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 \u0432 SIL"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/497866\/\">SIL \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 Atlassian Jira \u0438 Confluence. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e SIL \u0432\u043e\u0442 <a href=\"https:\/\/confluence.cprime.io\/pages\/viewpage.action?pageId=6560282\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  <a name=\"habracut\"><\/a> <br \/>  \u042f \u0447\u0430\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 SIL, \u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0412\u0430\u043c\u0438 \u043c\u043e\u0438\u043c\u0438 \u043c\u044b\u0441\u043b\u044f\u043c\u0438 \u043f\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 SIL \u00ab\u0447\u0438\u0441\u0442\u044b\u043c\u00bb.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u044e \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443\u044e\u0441\u044c \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 SIL, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u044e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/p>\n<h4>\u041f\u0440\u0430\u0432\u0438\u043b\u0430<\/h4>\n<p>  <\/p>\n<ol>\n<li>\u0418\u043c\u0435\u043d\u0430 <a href=\"https:\/\/confluence.cprime.io\/display\/SIL\/Syntax+and+types#Syntaxandtypes-Structures\" rel=\"nofollow\">\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440<\/a> \u043d\u0430\u0447\u0438\u043d\u0430\u0439\u0442\u0435 \u0441 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u044b.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/confluence.cprime.io\/display\/SIL\/arrayAddElement\" rel=\"nofollow\">AddElement<\/a>.<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438(<a href=\"https:\/\/confluence.cprime.io\/pages\/viewpage.action?pageId=6560003\" rel=\"nofollow\">user defined routines<\/a>), \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0412\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 \u0438 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0432 \u043a\u043e\u0434\u0435.<\/li>\n<li>\u0412\u044b\u043d\u043e\u0441\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438(<a href=\"https:\/\/confluence.cprime.io\/display\/SIL\/Inclusions\" rel=\"nofollow\">inclusions<\/a>).<\/li>\n<li>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0439\u0442\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0435\u0440\u0435\u0434 \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/li>\n<li>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0412\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c.<\/li>\n<li>\u0418\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 <a href=\"https:\/\/google.github.io\/styleguide\/javaguide.html\" rel=\"nofollow\">Google Java style guide<\/a>.<\/li>\n<\/ol>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 SIL.<\/p>\n<pre><code class=\"java\">string USER = currentUser(); \/\/ Response struct returnData {     string status; } \/\/ Project struct space {     string key; } \/\/ Inner part with content struct storage {     string value;     string representation; } \/\/ Part for storage struct body {     storage storage; } \/\/ Main entity for sending to Confluence struct reqData {     string type;     string title;     space space;     body body; } reqData data; data.type = &quot;page&quot;; data.title = &quot;Page for issue &quot; + key + &quot;  &quot; + summary + &quot;.&quot;; data.space.key = project; data.body.storage.value = &quot;&lt;p&gt; Author:&quot;+userFullName(USER) + &quot; description: &quot;  + description + &quot;&lt;\/p&gt;&quot;; data.body.storage.representation = &quot;storage&quot;; \/\/ Create request HttpRequest request; HttpHeader header = httpCreateHeader(&quot;Content-Type&quot;, &quot;application\/json&quot;); HttpHeader authHeader = httpBasicAuthHeader(&quot;admin&quot;, &quot;admin&quot;); request.headers += header; request.headers += authHeader; logPrint(&quot;WARN&quot;, request); \/\/POST string JSONData = toJson(data); logPrint(&quot;WARN&quot;, JSONData); returnData result = httpPost(&quot;http:\/\/192.168.54.203:8090\/rest\/api\/content\/&quot;, request, JSONData); string errMsg = httpGetErrorMessage(); logPrint(&quot;ERROR&quot;, &quot;Last error message: &quot; + errMsg); logPrint(&quot;WARN&quot;, result); string COMMENT = &quot;Page created in Confluence &quot; + updated + &quot; by &quot; + userFullName(USER) + &quot; Status : &quot; +result.status + &quot;.&quot;;  addComment(key, USER, COMMENT); \/\/Return Status return result.status; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434. \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u0432\u044b\u0448\u0435.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0412\u043e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"java\">struct body {     storage storage; }<\/code><\/pre>\n<p>  \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u00abstorage storage\u00bb, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c. \u0411\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u0431\u044b \u043a\u043e\u0434 \u0431\u044b\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"java\">struct body {     Storage storage; }<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0435 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u043e\u0434 \u0438\u043c\u0435\u043d\u0435\u043c storage \u0442\u0438\u043f\u0430 Storage. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0431\u0443\u043a\u0432\u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u043e\u0439:<\/p>\n<pre><code class=\"java\">\/\/ Response struct ReturnData {     string status; } \/\/ Project struct Space {     string key; } \/\/ Inner part with content struct Storage {     string value;     string representation; } \/\/ Part for storage struct Body {     Storage storage; } \/\/ Main entity for sending to Confluence struct ReqData {     string type;     string title;     Space space;     Body body; }<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430, \u0438 \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438:<\/p>\n<pre><code class=\"java\">struct Space {     string key; } struct Storage {     string value;     string representation; } struct Body {     Storage storage; } struct CreateConfluencePageRequest {     string type;     string title;     Space space;     Body body; } struct CreateConfluencePageResponse {     string status; }<\/code><\/pre>\n<p>  \u041f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e \u0442\u0430\u043a\u0438\u0435 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u041f\u0440\u0430\u0432\u0438\u043b\u0430 1, 5, 6.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440:<\/p>\n<pre><code class=\"java\">string USER = currentUser(); CreateConfluencePageRequest data; data.type = &quot;page&quot;; data.title = &quot;Page for issue &quot; + key + &quot;  &quot; + summary + &quot;.&quot;; data.space.key = project; data.body.storage.value = &quot;&lt;p&gt; Author:&quot;+userFullName(USER) + &quot; description: &quot;  + description + &quot;&lt;\/p&gt;&quot;; data.body.storage.representation = &quot;storage&quot;; \/\/ Create request HttpRequest request; HttpHeader header = httpCreateHeader(&quot;Content-Type&quot;, &quot;application\/json&quot;); HttpHeader authHeader = httpBasicAuthHeader(&quot;admin&quot;, &quot;admin&quot;); request.headers += header; request.headers += authHeader; logPrint(&quot;WARN&quot;, request); \/\/POST string JSONData = toJson(data); logPrint(&quot;WARN&quot;, JSONData); CreateConfluencePageResponse result = httpPost(&quot;http:\/\/192.168.54.203:8090\/rest\/api\/content\/&quot;, request, JSONData); string errMsg = httpGetErrorMessage(); logPrint(&quot;ERROR&quot;, &quot;Last error message: &quot; + errMsg); logPrint(&quot;WARN&quot;, result); string COMMENT = &quot;Page created in Confluence &quot; + updated + &quot; by &quot; + userFullName(USER) + &quot; Status : &quot; +result.status + &quot;.&quot;;  addComment(key, USER, COMMENT); \/\/Return Status return result.status;<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430 \u043a\u043e\u0434 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438:<\/p>\n<pre><code class=\"java\">getNewConfluencePageContent(); createHttpRequest(); createConfluencePage(); addCommentToJiraIssue(); <\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 Confluence, \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c http \u0437\u0430\u043f\u0440\u043e\u0441, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 Confluence \u0438 \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 Jira \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0447\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432 Confluence \u0441\u043e\u0437\u0434\u0430\u043d\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u044d\u0442\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"java\">function getNewConfluencePageContent() {     CreateConfluencePageRequest data;     data.type = &quot;page&quot;;     data.title = &quot;Page for issue &quot; + key + &quot;  &quot; + summary + &quot;.&quot;;     data.space.key = project;     data.body.storage.value = &quot;&lt;p&gt; Author:&quot;+userFullName(currentUser()) + &quot; description: &quot;  + description + &quot;&lt;\/p&gt;&quot;;     data.body.storage.representation = &quot;storage&quot;;     return toJson(data); }  function createHttpRequest() {     HttpRequest request;     HttpHeader header = httpCreateHeader(&quot;Content-Type&quot;, &quot;application\/json&quot;);     HttpHeader authHeader = httpBasicAuthHeader(&quot;admin&quot;, &quot;admin&quot;);     request.headers = addElement(request.headers, header);     request.headers += addElement(request.headers, authHeader);     logPrint(&quot;WARN&quot;, request);     return request; }  function createConfluencePage(string pageJson) {     HttpRequest request = createHttpRequest();     CreateConfluencePageResponse result = httpPost(&quot;http:\/\/192.168.54.203:8090\/rest\/api\/content\/&quot;, request, pageJson);     logPrint(&quot;ERROR&quot;, &quot;Last error message: &quot; + httpGetErrorMessage());     logPrint(&quot;WARN&quot;, result);     return result; }  function addCommentToJiraIssue(string resultStatus) {     string COMMENT = &quot;Page created in Confluence &quot; + updated + &quot; by &quot; + userFullName(currentUser()) + &quot; Status : &quot; +resultStatus + &quot;.&quot;;      addComment(key, currentUser(), COMMENT); }  string pageJson = getNewConfluencePageContent(); CreateConfluencePageResponse result = createConfluencePage(pageJson); addCommentToJiraIssue(result.status); return result.status; <\/code><\/pre>\n<p>  \u041c\u044b \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u041f\u0440\u0430\u0432\u0438\u043b\u043e 2). \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">string pageJson = getNewConfluencePageContent(); CreateConfluencePageResponse result = createConfluencePage(pageJson); addCommentToJiraIssue(result.status); return result.status; <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0443 \u043d\u0430\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c json \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 Confluence, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 Confluence. \u042d\u0442\u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0434\u0430\u044e\u0442 \u043d\u0430\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442. \u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 Confluence, \u0442\u043e \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 getNewConfluencePageContent \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438\u0437\u0443\u0447\u0430\u044f \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 Confluence \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b confluence_helper.incl \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 Confluence \u0432 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"java\">struct Space {     string key; } struct Storage {     string value;     string representation; } struct Body {     Storage storage; } struct CreateConfluencePageRequest {     string type;     string title;     Space space;     Body body; } struct CreateConfluencePageResponse {     string status; }  function createHttpRequest() {     HttpRequest request;     HttpHeader header = httpCreateHeader(&quot;Content-Type&quot;, &quot;application\/json&quot;);     HttpHeader authHeader = httpBasicAuthHeader(&quot;admin&quot;, &quot;admin&quot;);     request.headers = addElement(request.headers, header);     request.headers += addElement(request.headers, authHeader);     logPrint(&quot;INFO&quot;, request);     return request; }  function createConfluencePage(string confluenceUrl, string pageJson) {     HttpRequest request = createHttpRequest();     CreateConfluencePageResponse result = httpPost(confluenceUrl, request, pageJson);     logPrint(&quot;ERROR&quot;, &quot;Last error message: &quot; + httpGetErrorMessage());     logPrint(&quot;INFO&quot;, result);     return result; } <\/code><\/pre>\n<p>  \u042f \u0441\u0434\u0435\u043b\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e createConfluencePage \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u0439, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0435 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 confluenceUrl. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u041f\u0440\u0430\u0432\u0438\u043b\u043e 4.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">include &quot;confluence_helper.incl&quot;;  function getNewConfluencePageContent() {     CreateConfluencePageRequest data;     data.type = &quot;page&quot;;     data.title = &quot;Page for issue &quot; + key + &quot;  &quot; + summary + &quot;.&quot;;     data.space.key = project;     data.body.storage.value = &quot;&lt;p&gt; Author:&quot;+userFullName(currentUser()) + &quot; description: &quot;  + description + &quot;&lt;\/p&gt;&quot;;     data.body.storage.representation = &quot;storage&quot;;     return toJson(data); }  function addCommentToJiraIssue(string resultStatus) {     string comment = &quot;Page created in Confluence &quot; + updated + &quot; by &quot; + userFullName(currentUser()) + &quot; Status : &quot; +resultStatus + &quot;.&quot;;      addComment(key, currentUser(), comment); }   const string CONFLUENCE_URL = &quot;http:\/\/192.168.54.203:8090\/rest\/api\/content\/&quot;;  string pageJson = getNewConfluencePageContent(); CreateConfluencePageResponse result = createConfluencePage(CONFLUENCE_URL, pageJson); addCommentToJiraIssue(result.status); return result.status; <\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u044f \u0432\u043a\u043b\u044e\u0447\u0438\u043b \u0444\u0430\u0439\u043b confluence_helper.incl, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 Confluence.<\/p>\n<p>  \u042f \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u0430\u0434\u0440\u0435\u0441 Confluence \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0438\u043c\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 Google Java notation style (\u041f\u0440\u0430\u0432\u0438\u043b\u043e 7).<\/p>\n<p>  \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u043e\u043c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 Confluence, \u0438 \u043d\u0430\u0448 \u043a\u043e\u0434 \u0441\u0442\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u043c.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/497866\/\"> https:\/\/habr.com\/ru\/post\/497866\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/497866\/\">SIL \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 Atlassian Jira \u0438 Confluence. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e SIL \u0432\u043e\u0442 <a href=\"https:\/\/confluence.cprime.io\/pages\/viewpage.action?pageId=6560282\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-302121","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302121"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302121\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}