Objective-C library for using Redmine
- SBJSON
- Hpple
RKRedmine *myRedmine = [[RKRedmine alloc] init];
myRedmine.serverAddress = @"http://www.myredmine.com";
myRedmine.username = @"username";
myRedmine.password = @"my_password";
[myRedmine login];
NSArray *projects = [myRedmine projects];
for (RKProject *project in projects) {
NSLog(@"=> %@", project.name);
}
RKProject *myProject = [myRedmine projectForIndex:myProjectIndex];
myProject.sortIssuesBy = RKIssueSortByAssignedTo;
myProject.orderIssuesDesc = [NSNumber numberWithBool:YES];
NSArray *issues = [myProject issues];
for (RKIssue *issue in issues) {
NSLog(@"=> %@", issue.subject);
NSArray *journals = [issue journals];
for (RKJournal *journal in journals) {
NSLog(@"==> %@: %@", journal.createdOn, journal.notes);
}
}
RKIssue *myNewIssue = [[RKIssue alloc] init];
myNewIssue.subject = @"My issue's subject";
myNewIssue.issueDescription = @"This is how I describe an issue";
RKIssueOptions *newIssueOptions = [myProject newIssueOptions];
myNewIsuse.tracker = [[newIssueOptions trackers] objectAtIndex:chosenTrackerIndex];
[myProject postNewIssue:myNewIssue];
RKIssue *myIssue = [myRedmine issueForIndex:myIssueIndex];
RKIssueOptions *updateOptions = [myIssue updateOptions];
myIssue.assignedTo = [updateOptions.assignableUsers objectAtIndex:assignedUserIndex];
[myIssue postUpdateWithNotes:@"Assigned to user X for review"];
RKIssue *myIssue = [myRedmine issueForIndex:myIssueIndex];
RKIssueOptions *options = [myIssue updateOptions];
RKTimeEntry *entry = [[RKTimeEntry alloc] init];
entry.spentOn = [options.activities objectAtIndex:activityIndex];
entry.hours = [NSNumber numberWithFloat:3.5];
entry.comments = @"Here it goes a comment for this time entry"
[myIssue postTimeEntry:entry];