Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. let stringPart1 = '';
  2. let stringPart2 = '';
  3. let stringPart3 = '';
  4.  
  5. stringPart1 = '<div class="type truncate">' + type + '</div><div class="id">' + id + '</div><div class="title">' + title + '</div>';
  6. if (workItemDetails[x].relations) {
  7. workItemDetails[x].relations.forEach(function(relation) {
  8. if (relation.rel === 'System.LinkTypes.Hierarchy-Reverse') {
  9. let parentId = relation.url.split('/').slice(-1)[0];
  10. witClient.getWorkItem(parentId, ['System.Title']).then(function(value) {
  11. let parentWorkItemTitleString = value.fields['System.Title'];
  12. returnString = '<div class="parent-id"><strong>' + parentId + '</div><div class="parent-name">' + parentWorkItemTitleString + '</div>';
  13. console.log(returnString);
  14. stringPart2 = returnString;
  15. });
  16. }
  17. });
  18. }
  19.  
  20. if(cardCount % 15 === 0 && x != 0) {
  21. stringPart3 = '</section>';
  22. sheetCount++;
  23. } else {
  24. stringPart3 = '';
  25. }
  26.  
  27. div.innerHTML = stringPart1 + stringPart2 + stringPart3;
  28. document.getElementById(sheetId).appendChild(div); ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement