public ScrumwiseItemList ConvertKanbasToScrum(KanbanizeTaskList kanbasTask) { ScrumwiseItemList scrumwiseItemList = new ScrumwiseItemList(); scrumwiseItemList.TaskList = new List <Backlogitem>(); for (int i = 0; i < kanbasTask.TaskList.Count; i++) { Backlogitem container = new Backlogitem(); container.backlogListID = _backlogListID; container.description = kanbasTask.TaskList[i].Description; //if externalID==null then externalID ="0" if (container.externalID == null) { container.externalID = "0"; } container.externalID = kanbasTask.TaskList[i].TaskId; container.priority = kanbasTask.TaskList[i].Priority; container.projectID = _projectID; container.tagIDs = _scrumwiseKanbanizeTag; container.name = kanbasTask.TaskList[i].Title; container.type = "Feature"; container.status = kanbasTask.TaskList[i].Columnname.ToLower(); container = VariableFitter(container); scrumwiseItemList.TaskList.Add(container); } return(scrumwiseItemList); }
private bool KanbanizeMoveTask(Backlogitem backlogitem, KanbanizeTaskList kanbanizeTask) { RestClient client = new RestClient(_apiurl); RestRequest request = new RestRequest("move_task", Method.POST); VariableFitter(backlogitem); foreach (Item itemToBeChecked in kanbanizeTask.TaskList) { if (backlogitem.externalID.ToString() == itemToBeChecked.TaskId) { if (itemToBeChecked.Columnname == "Arkiv" && backlogitem.status == KanbanizeStatus.done.ToString()) { return(false); } } } request.AddHeader(_apiKey, _apiKeyValue); request.AddJsonBody(new { boardid = _boardID, taskid = backlogitem.externalID, column = backlogitem.status }); var response = client.Post(request); return(false); }
private bool CreateKanbanizeTask(Backlogitem backlogitem) { KanbanizeTaskList kanbanizeTasks = new KanbanizeTaskList(); KanbasID kanbasID = new KanbasID(); backlogitem = VariableFitter(backlogitem); if (backlogitem.status == "arkiv") { return(true); } RestClient client = new RestClient(_apiurl); RestRequest request = new RestRequest("create_new_task", Method.POST); request.AddHeader(_apiKey, _apiKeyValue); request.AddJsonBody(new { boardid = _boardID, column = backlogitem.status, lane = _lane, priority = backlogitem.priority, type = backlogitem.type, title = backlogitem.name, description = backlogitem.description }); var response = client.Post(request); var xmlDeserializer = new RestSharp.Deserializers.XmlDeserializer(); kanbasID = xmlDeserializer.Deserialize <KanbasID>(response); backlogitem.externalID = kanbasID.id; _scrumwiseConnection.setBacklogItemExternalID(backlogitem); //Scrum.API.UpdateExternalID(backlogITem.ExternalID) return(true); }
private void AddSprint(Backlogitem backlogitem) { RestClient client = new RestClient(_apiurl); client.Authenticator = new HttpBasicAuthenticator(_userName, _key); RestRequest request = new RestRequest("assignBacklogItemToSprint", Method.POST); request.AddParameter("sprintID", backlogitem.sprintID); request.AddParameter("teamID", _teamID); request.AddParameter("backlogItemID", backlogitem.id); var response = client.Execute(request); }
private Backlogitem VariableFitter(Backlogitem backlogitem) { switch (backlogitem.status) { case "To do": backlogitem.status = KanbanizeStatus.planlagt.ToString(); break; case "In progress": backlogitem.status = KanbanizeStatus.igang.ToString().Insert(1, " "); break; case "Done": backlogitem.status = KanbanizeStatus.done.ToString(); break; case "New": backlogitem.status = KanbanizeStatus.planlagt.ToString(); break; case "Sprint completed": backlogitem.status = KanbanizeStatus.arkiv.ToString(); break; } switch (backlogitem.priority) { case "Low": backlogitem.priority = ScrumwisePriority.Low.ToString(); break; case "Average": backlogitem.priority = ScrumwisePriority.Medium.ToString(); break; case "High": backlogitem.priority = ScrumwisePriority.High.ToString(); break; case "Critical": backlogitem.priority = ScrumwisePriority.Urgent.ToString(); break; } return(backlogitem); }
private bool KanbanizeEditTask(Backlogitem backlogitem) { try { RestClient client = new RestClient(_apiurl); RestRequest request = new RestRequest("edit_task", Method.POST); request.AddHeader(_apiKey, _apiKeyValue); request.AddJsonBody(new { boardid = _boardID, taskid = backlogitem.externalID, tags = "Rejected" }); var response = client.Post(request); return(true); } catch (Exception) { return(false); throw; } }
public bool setBacklogItemExternalID(Backlogitem scrumwiseItem) { try { RestClient client = new RestClient(_apiurl); client.Authenticator = new HttpBasicAuthenticator(_userName, _key); RestRequest req = new RestRequest("setBacklogItemExternalID", Method.POST); req.AddParameter("backlogItemID", scrumwiseItem.id); req.AddParameter("externalID", scrumwiseItem.externalID); var createResult = client.Execute <CreateBacklogItemResult>(req); return(true); } catch (Exception) { return(false); throw; } }
public bool CreateBacklogItem(Backlogitem scrumwiseItem) { try { RestClient client = new RestClient(_apiurl); client.Authenticator = new HttpBasicAuthenticator(_userName, _key); RestRequest req = new RestRequest("addBacklogItem", Method.POST); req.AddParameter("projectID", scrumwiseItem.projectID); req.AddParameter("backlogListID", scrumwiseItem.backlogListID); req.AddParameter("externalID", scrumwiseItem.externalID); req.AddParameter("type", scrumwiseItem.type); if (_estimateUnit != null) { req.AddParameter("estimate", scrumwiseItem.estimate); req.AddParameter("estimateUnit", _estimateUnit); } req.AddParameter("name", scrumwiseItem.name); req.AddParameter("description", scrumwiseItem.description); if (scrumwiseItem.priority == ScrumwisePriority.Low.ToString()) { req.AddParameter("priority", "Low"); } else if (scrumwiseItem.priority == ScrumwisePriority.Medium.ToString()) { req.AddParameter("priority", "Medium"); } else if (scrumwiseItem.priority == ScrumwisePriority.High.ToString()) { req.AddParameter("priority", "High"); } else if (scrumwiseItem.priority == ScrumwisePriority.Urgent.ToString()) { req.AddParameter("priority", "Urgent"); } /* * else * { * throw new Exception("Unknown priority"); * }*/ var createResult = client.Execute <CreateBacklogItemResult>(req); if (createResult.IsSuccessful) { string itemID = createResult.Data.Result; scrumwiseItem.id = itemID; foreach (var tagID in scrumwiseItem.tagIDs) { AddTag(itemID, tagID); } if (scrumwiseItem.sprintID != null) { AddSprint(scrumwiseItem); } return(true); } } catch (Exception) { throw; } return(false); }