第一步

从字段或者文件中选取json源

Json输入 - 图1

第二步

字段定义如何解析源json

Json输入 - 图2

上面对应的json如下:

  1. {
  2. "expand": "description,lead,url,projectKeys",
  3. "self": "http://172.26.1.51:8080/rest/api/2/project/10902",
  4. "id": "10902",
  5. "key": "SAMPLE",
  6. "description": "",
  7. "lead": {
  8. "self": "http://172.26.1.51:8080/rest/api/2/user?username=summ",
  9. "key": "summ",
  10. "name": "summ",
  11. "avatarUrls": {
  12. "48x48": "http://172.26.1.51:8080/secure/useravatar?ownerId=summ&avatarId=10600",
  13. "24x24": "http://172.26.1.51:8080/secure/useravatar?size=small&ownerId=summ&avatarId=10600",
  14. "16x16": "http://172.26.1.51:8080/secure/useravatar?size=xsmall&ownerId=summ&avatarId=10600",
  15. "32x32": "http://172.26.1.51:8080/secure/useravatar?size=medium&ownerId=summ&avatarId=10600"
  16. },
  17. "displayName": "苏敏敏",
  18. "active": true
  19. },
  20. "components": [],
  21. "issueTypes": [
  22. {
  23. "self": "http://172.26.1.51:8080/rest/api/2/issuetype/10100",
  24. "id": "10100",
  25. "description": "需要完成的任务。",
  26. "iconUrl": "http://172.26.1.51:8080/secure/viewavatar?size=xsmall&avatarId=10318&avatarType=issuetype",
  27. "name": "任务",
  28. "subtask": false,
  29. "avatarId": 10318
  30. },
  31. {
  32. "self": "http://172.26.1.51:8080/rest/api/2/issuetype/10101",
  33. "id": "10101",
  34. "description": "问题的子任务",
  35. "iconUrl": "http://172.26.1.51:8080/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype",
  36. "name": "子任务",
  37. "subtask": true,
  38. "avatarId": 10316
  39. },
  40. {
  41. "self": "http://172.26.1.51:8080/rest/api/2/issuetype/10102",
  42. "id": "10102",
  43. "description": "由 Jira Software 创建——请勿编辑或删除。适用于一种用户故事的事务类型。",
  44. "iconUrl": "http://172.26.1.51:8080/secure/viewavatar?size=xsmall&avatarId=10315&avatarType=issuetype",
  45. "name": "故事",
  46. "subtask": false,
  47. "avatarId": 10315
  48. },
  49. {
  50. "self": "http://172.26.1.51:8080/rest/api/2/issuetype/10103",
  51. "id": "10103",
  52. "description": "",
  53. "iconUrl": "http://172.26.1.51:8080/secure/viewavatar?size=xsmall&avatarId=10303&avatarType=issuetype",
  54. "name": "故障",
  55. "subtask": false,
  56. "avatarId": 10303
  57. },
  58. {
  59. "self": "http://172.26.1.51:8080/rest/api/2/issuetype/10000",
  60. "id": "10000",
  61. "description": "Created by Jira Software - do not edit or delete. Issue type for a big user story that needs to be broken down.",
  62. "iconUrl": "http://172.26.1.51:8080/images/icons/issuetypes/epic.svg",
  63. "name": "Epic",
  64. "subtask": false
  65. }
  66. ],
  67. "assigneeType": "UNASSIGNED",
  68. "versions": [],
  69. "name": "Scrum项目模板",
  70. "roles": {
  71. "Test supervisor": "http://172.26.1.51:8080/rest/api/2/project/10902/role/10104",
  72. "Product Manager": "http://172.26.1.51:8080/rest/api/2/project/10902/role/10102",
  73. "Developers": "http://172.26.1.51:8080/rest/api/2/project/10902/role/10101",
  74. "Product Tester": "http://172.26.1.51:8080/rest/api/2/project/10902/role/10106",
  75. "Project Manager": "http://172.26.1.51:8080/rest/api/2/project/10902/role/10103",
  76. "Administrators": "http://172.26.1.51:8080/rest/api/2/project/10902/role/10002",
  77. "Developer": "http://172.26.1.51:8080/rest/api/2/project/10902/role/10105"
  78. },
  79. "avatarUrls": {
  80. "48x48": "http://172.26.1.51:8080/secure/projectavatar?avatarId=10324",
  81. "24x24": "http://172.26.1.51:8080/secure/projectavatar?size=small&avatarId=10324",
  82. "16x16": "http://172.26.1.51:8080/secure/projectavatar?size=xsmall&avatarId=10324",
  83. "32x32": "http://172.26.1.51:8080/secure/projectavatar?size=medium&avatarId=10324"
  84. },
  85. "projectTypeKey": "software",
  86. "archived": false
  87. }

如何解析json数组

  1. [
  2. {
  3. "expand": "description,lead,url,projectKeys",
  4. "self": "http://172.26.1.51:8080/rest/api/2/project/10902",
  5. "id": "10902",
  6. "key": "SAMPLE",
  7. "name": "Scrum项目模板",
  8. "avatarUrls": {
  9. "48x48": "http://172.26.1.51:8080/secure/projectavatar?avatarId=10324",
  10. "24x24": "http://172.26.1.51:8080/secure/projectavatar?size=small&avatarId=10324",
  11. "16x16": "http://172.26.1.51:8080/secure/projectavatar?size=xsmall&avatarId=10324",
  12. "32x32": "http://172.26.1.51:8080/secure/projectavatar?size=medium&avatarId=10324"
  13. },
  14. "projectTypeKey": "software"
  15. },
  16. {
  17. "expand": "description,lead,url,projectKeys",
  18. "self": "http://172.26.1.51:8080/rest/api/2/project/10904",
  19. "id": "10904",
  20. "key": "SYBI",
  21. "name": "SyBI",
  22. "avatarUrls": {
  23. "48x48": "http://172.26.1.51:8080/secure/projectavatar?avatarId=10324",
  24. "24x24": "http://172.26.1.51:8080/secure/projectavatar?size=small&avatarId=10324",
  25. "16x16": "http://172.26.1.51:8080/secure/projectavatar?size=xsmall&avatarId=10324",
  26. "32x32": "http://172.26.1.51:8080/secure/projectavatar?size=medium&avatarId=10324"
  27. },
  28. "projectTypeKey": "software"
  29. }
  30. ]

如上所示的json是一个array,如何获取id呢?

Json输入 - 图3

注意是 $.[*]id