我正在尝试使用R将超链接传递给JIRA描述字段,如SharePoint Link,但最终显示此
<a href='somesite.com/sites/site/Documents/DocFolder/fileName.ext' target='_blank'>SharePoint Link</a>.
有关如何解决这个问题的任何建议吗?
这是我正在使用的代码。
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()
)
答案 0 :(得分:1)
如果我没有被误解,那么您正在寻找正确创建LinkToFileInSharePoint
所以让我们试试这个
LinkToFileInSharePoint <- paste0("<a href='",SPurl,"' target='_blank'>","SharePoint Link</a>")
希望这有帮助!