sort.IssuesTB {IssueTrackeR} | R Documentation |
Sort issues
Description
Sorting issues with some constraint and order on the labels, the title, the milestones and/or the body.
Usage
## S3 method for class 'IssuesTB'
sort(
x,
decreasing = FALSE,
sorting_variables = list(),
filtering_factors = list(),
...
)
Arguments
x |
a |
decreasing |
logical. Should the sort be increasing or decreasing? |
sorting_variables |
a list containing the quantitative variables to sort the issues. The filters are applied in the order of the variables supplied. |
filtering_factors |
a list containing constraints for sorting issues by sub-group in order of priority |
... |
Additional arguments related to milestones for the function
|
Details
In the order of the constraints imposed by the filtering_factors
argument, the function will first filter by constraint. For each constraint,
the function will then sort according to the quantitative variables supplied
in sorting_variables
.
For example, the following call:
sort( x = issues, sorting_variables = list(c(object = "milestones", field = "due_on"), c(object = "issues", field = "created_at")), filtering_factors = list(list(values = "bug", fields = "labels", values_logic_gate = "OR"), list(values = "package", fields = "title")), decreasing = TRUE )
will behave as follows:
-
It will select all the issues that have "bug" as a label, then sort them according to the chronological order of milestones (according to deadlines) and the chronological order of issue creation dates
-
Among the remaining issues, it will filter the issues that have
"package"
in the title and apply the same sorting.
-
Finally, among all the remaining issues (not sorted until now), the function will apply the same sorting.
-
The function returns the global list of sorted issues.
The argument filtering_factors is a list of constraint following the same
naming convention as the filter_issues
. So the
constraints are represented by named lists with the various arguments (apart
from x
) to the filter_issues
(values
, fields
, fields_logic_gate
,
values_logic_gate
and negate
).
Value
a IssuesTB
object sorted.
Examples
# Get the milestones of the prject
milestones <- get_milestones("online")
write_milestones_to_dataset(milestones)
all_issues <- get_issues(source = "online", verbose = FALSE)
sorted_issues <- sort(
x = all_issues,
sorting_variables = list(list(object = "milestones", field = "due_on"),
list(object = "issues", field = "created_at")),
filtering_factors = list(list(values = "bug",
fields = "labels",
values_logic_gate = "OR"),
list(values = "package", fields = "title")),
milestones = milestones
)