RanonKahn
RanonKahn

Reputation: 872

Passing a Hyperlink to JIRA 'description' field using R

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()
                 )

Upvotes: 0

Views: 2031

Answers (1)

Prem
Prem

Reputation: 11965

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!

Upvotes: 2

Related Questions