Skip to content

Commit 364182a

Browse files
authored
Expand custom stages docs (#1)
no-work-item
1 parent ae88736 commit 364182a

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,29 +335,49 @@ To declare this in the metadata, ensure the status is represented in the extract
335335
"stage_diagram": {
336336
"controlling_field": "status",
337337
"starting_stage": "detected",
338+
"no_transitions_defined": false,
338339
"stages": {
339340
"detected": {
340341
"stage_name": "Detected",
341-
"transitions_to": ["mitigated", "archived", "rca_ready"]
342+
"transitions_to": ["mitigated", "archived", "rca_ready"],
343+
"state": "new"
342344
},
343345
"mitigated": {
344346
"stage_name": "Mitigated",
345-
"transitions_to": ["archived", "detected"]
347+
"transitions_to": ["archived", "detected"],
348+
"state": "work_in_progress"
346349
},
347350
"rca_ready": {
348351
"stage_name": "RCA Ready",
349-
"transitions_to": ["archived"]
352+
"transitions_to": ["archived"],
353+
"state": "work_in_progress"
350354
},
351355
"archived": {
352356
"stage_name": "Archived",
353-
"transitions_to": []
357+
"transitions_to": [],
358+
"state": "completed"
354359
}
360+
},
361+
"states": {
362+
"new": {
363+
"name": "New"
364+
},
365+
"work_in_progress": {
366+
"name": "Work in Progress"
367+
},
368+
"completed": {
369+
"name": "Completed",
370+
"is_end_state": true
371+
},
355372
}
356373
}
357374
}
358375
```
359376

360-
In the above example, the status field is declared the controlling field of the stage diagram, which then specifies the transitions for each stage.
377+
In the above example, the status field is declared the controlling field of the stage diagram, which then specifies the transitions for each stage.
378+
It is possible that the status field has no explicit transitions defined but one would still like to create a stage diagram in DevRev. In that case you should use set the `no_transitions_defined` field to `true`, which will create a diagram where all the defined stages can transition to each other.
379+
The external system might have a way to categorize statuses (such as status categories in Jira). These can also be included in the diagram metadata (`states` in the example above) which will create them in DevRev and they can be referenced by the stages. This is entirely optional and in case the `states` field is not provided, default DevRev states will be used, those being `open`, `in_progress` and `closed`. If there is a way, the developer can categorize the stages to one of these three, or leave it up to the end user.
380+
The `starting_stage` field defines the starting stage of the diagram, in which all new instances of the object will be created. This data should always be provided if available, otherwise the starting stage will be selected alphabetically.
361381

362382
## Normalize data
363383

0 commit comments

Comments
 (0)