Passing a Hyperlink to JIRA 'description' field using R

随声附和 提交于 2019-12-12 04:41:52

问题


I am trying to pass an hyperlink to JIRA description field like this SharePoint Link using R but ending up displaying this

<a href='somesite.com/sites/site/Documents/DocFolder/fileName.ext' target='_blank'>SharePoint Link</a>.

Any suggestion on how to fix this?

This is the code I am using.

library(httr)

SPurl <- "somesite.com/sites/site/Documents/DocFolder/fileName.ext"
LinkToFileInSharePoint <- paste0("<a href='",SPurl,"' target='_blank'>",SharePoint Link,"</a>")
x <- list( fields = list(project = c(key = "TEST"), 
                              summary = "New Ticket", 
                              description = LinkToFileInSharePoint,
                              issuetype = c(name = "Task"), 
                              assignee = c(name ="AssigneeUserName")
                              )
               )
response <- POST("https://somesite.atlassian.net/rest/api/2/issue/",
                 body = RJSONIO::toJSON(x), 
                 authenticate("username", "password", "basic"),
                 add_headers("Content-Type" = "application/json"),
                 verbose()
                 )

回答1:


If I am not misunderstood then you are looking to create LinkToFileInSharePoint properly so let's try this

LinkToFileInSharePoint <- paste0("<a href='",SPurl,"' target='_blank'>","SharePoint Link</a>")


Hope this helps!



来源:https://stackoverflow.com/questions/46004959/passing-a-hyperlink-to-jira-description-field-using-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!