Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch custom fields from jira using JiAgileR library

Prateek Rawat July 11, 2022

Hi All,

I am using below code to access JIRA issues. I am able to fetch all the fields except for custom fields such as Business Analyst,  Business Sponsor Function etc:

library(JirAgileR, quietly = T)
library(knitr, quietly = T)
library(dplyr, quietly = T)

if (is.null(JIRABaseURL)) JIRABaseURL
if (is.null(username)) username
if (is.null(password)) password

fields1<-get_jira_issues(domain = JIRABaseURL,
  username = username,
  password = password,
  jql_query = "project in('My Project')",
  fields = c('duedate', 'updateddate', 'components'), 
  maxResults = 50,
  verbose = FALSE,
  as.data.frame = TRUE)

How can I fetch custom fields using JirAgileR  

1 answer

1 accepted

0 votes
Answer accepted
Prateek Rawat July 22, 2022

I figured out the solution.

custom fields can be fetched using customfield_12345 keyword where 12345 is the id of the custom field.

I managed to find it using inspect elements under developer tools in the browser.

Below is the code snippet of the element where i managed to find the custom field details

<th class="colHeaderLink sortable headerrow-customfield_12345" rel="customfield_12345:ASC" data-id="customfield_12345" onclick="window.document.location='/issues/?jql=ORDER%20BY%20%22customfield_12345%22%20ASC'">
<span title="Sort By Business sponsor">Business sponsor</span>
</th>

 

below is the code for fetching the custom field:

 

library(JirAgileR, quietly = T)
library(knitr, quietly = T)
library(dplyr, quietly = T)

if (is.null(JIRABaseURL)) JIRABaseURL
if (is.null(username)) username
if (is.null(password)) password

fields1<-get_jira_issues(domain = JIRABaseURL,
  username = username,
  password = password,
  jql_query = "project in('My Project')",
  fields = c('duedate', 'updateddate', 'components', 'customfield_12345'), 
  maxResults = 50,
  verbose = FALSE,
  as.data.frame = TRUE)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events