def update(self, item): super(JiraTracker, self).update(item) print("Update Jira Ticket:") if item.Id() is None: print(item.asRemoteItem()) issue = self.trackerInstance_.createIssue(self.authentication_, item.asRemoteItem()) else: print(item.piecesToUpdate()) issue = self.trackerInstance_.updateIssue(self.authentication_, item.Id(), item.piecesToUpdate()) updatedItem = JiraTrackerItem(issue) if "status" in str(item.piecesToUpdate()): updatedItem.withStatus(item.status()) updatedItem = JiraTrackerItem(self._ticketWithUpdatedStatusFrom(updatedItem)) print(item.comments("new")) updatedItem.withComments(item.comments("new")) # to be fully complete updatedItem also needs exisiting comments - tbd return self.updateCommentsFor(updatedItem)
def update(self, item): super(JiraTracker, self).update(item) print("Update Jira Ticket:") if (item.Id() is None): print(item.asRemoteItem()) issue = self.trackerInstance_.createIssue(self.authentication_, item.asRemoteItem()) else: print(item.piecesToUpdate()) issue = self.trackerInstance_.updateIssue(self.authentication_, item.Id(), item.piecesToUpdate()) updatedItem = JiraTrackerItem(issue) if "status" in str(item.piecesToUpdate()): updatedItem.withStatus(item.status()) updatedItem = JiraTrackerItem( self._ticketWithUpdatedStatusFrom(updatedItem)) print(item.comments('new')) updatedItem.withComments(item.comments('new')) # to be fully complete updatedItem also needs exisiting comments - tbd return self.updateCommentsFor(updatedItem)
def test_canCopyNewComments(self): item = JiraTrackerItem() commentsToCopy = ["comment1", "comment2"] item.withComments(commentsToCopy) self.assertEqual(item.comments('new'), commentsToCopy)
def test_canCopyNewComments(self): item = JiraTrackerItem() commentsToCopy = ["comment1", "comment2"] item.withComments(commentsToCopy) self.assertEqual(item.comments('new'), commentsToCopy)