Comments (4)
Hi @hannessnogren, my apologies for the late response - I come back to this always when I have time. I will check your issue and come back to you.
from jiragiler.
I had the same issue for the duedate.
After looking a bit into your function I found the problem:
Let's say you have two issues and one does not have an duedate (or resolutiondate or any other field). Within JiraJSON2df
you check for the format of the field and set is to NA
if it is missing. In the next step you use data.table::rbindlist()
and here is the error.
The two data.tables are combined, but one has a date column and the other one a logical.
Maybe a solution would be to check all fields and set them to the most used class?
from jiragiler.
UPDATE:
I added some data.table::as.data.table and fiexd some issues.
Here is an approach to set columns, that have different classes all to characters:
DT1 <- data.table(VAR1 = "a", VAR2 = as.Date("2020-04-02"))
DT2 <- data.table(VAR1 = "b", VAR2 = NA)
DT3 <- data.table(VAR1 = "c", VAR2 = as.Date("2020-04-02"))
check_dt <- function(input = list()) {
classes <- lapply(input, function(dt) {
dt <- data.table::as.data.table(dt)
as.data.table(t(dt[, sapply(.SD, class), .SDcol = names(dt)]))}
)
classes_dt <- rbindlist(classes)
idx <- classes_dt[, sapply(.SD, uniqueN), .SDcol = names(classes_dt)] > 1
idx_cols <- names(idx)[idx]
output <- lapply(input, function(dt, idx_cols){
dt <- data.table::as.data.table(dt)
these_cols <- intersect(names(dt), idx_cols)
if (length(these_cols) >0 ) {
dt[, c(these_cols) := lapply(.SD, as.character), .SDcol = these_cols]
}
return(dt)
},
idx_cols = idx_cols)
return(output)
}
rbindlist(check_dt(input = list(DT1, DT2, DT3)))
> out
VAR1 VAR2
1: a 2020-04-02
2: b <NA>
3: c 2020-04-02
from jiragiler.
Hi @hannessnogren & @Dschaykib, I changed substantially the internals of the package to increase the robustness of the package and to give a better support for JQL fields. With the latest commit 3452c86 Now your queries should work - here an example with the field "resolutiondate":
JiraQuery2R(domain = "https://bitvoodoo.atlassian.net",
query = "project='CONGRATS'",
fields = c("resolutiondate")) %>%
head() %>% knitr::kable()
id | self | key | ID | resolutiondate |
---|---|---|---|---|
57849 | https://bitvoodoo.atlassian.net/rest/api/latest/issue/57849 | CONGRATS-39 | 1 | NA |
57848 | https://bitvoodoo.atlassian.net/rest/api/latest/issue/57848 | CONGRATS-38 | 2 | NA |
57847 | https://bitvoodoo.atlassian.net/rest/api/latest/issue/57847 | CONGRATS-37 | 3 | NA |
57810 | https://bitvoodoo.atlassian.net/rest/api/latest/issue/57810 | CONGRATS-36 | 4 | 2019-10-29 09:32:08 |
57667 | https://bitvoodoo.atlassian.net/rest/api/latest/issue/57667 | CONGRATS-32 | 5 | 2019-09-23 16:33:36 |
57502 | https://bitvoodoo.atlassian.net/rest/api/latest/issue/57502 | CONGRATS-30 | 6 | 2019-05-20 09:00:11 |
@Dschaykib - I tried your commit, and while it solved some of the issues (it did not work always), I preferred to rethink the internal logic instead of repatching the issue. But thank you very much for your help, it helped me quite a lot.
from jiragiler.
Related Issues (12)
- Column names and values do not match when "comment" field is used and as.data.frame = TRUE
- Adding customfields
- Just started using it HOT 1
- Using API Key for private projects?
- Error encountered in get_jira_dashboards()
- Error: API did not return json Issue HOT 8
- Historic data
- Removed from CRAN
- Minor documentation suggestions re: resolutiondate and get_jira_projects() HOT 2
- Error: Error Code 403 - Client error: (403) Forbidden HOT 3
- Add field «Sprint» to list of available fields HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jiragiler.