问题
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