Verified Commit d924ead9 authored by Lukas Wiest's avatar Lukas Wiest 🚂
Browse files

refactor(docs): api: core: write 'Ticket'

parent ec2a775d
Pipeline #1376 passed with stages
in 1 minute and 9 seconds
# Ticket
!!! todo
write usage api docs
A ticket instance represents one ticket of the connected space.
## get/create ticket
The class is not publicly constructable,
as it always belongs to a `TicketSystem` object.
Getting an instance for a existing ticket,
or creating a new one,
is done from a `TicketSystem` instance.
[->For details see here <-](./ticket-system.md)
## reading data
There are various getters available.
Below the globally defined ones are listed,
each system specific implementation is free to provide additional ones.
!!! warning
systems are not guaranteed to support all data,
a global getter is defined for.
Therefore it can happen, you get an null value back
or exception thrown in this case.
| method | return |
| :----------------- | :-------------------- |
| `getAssignees()` | `Set<TicketAssignee>` |
| `getDescription()` | `String` |
| `getId()` | `String` |
| `getLabels()` | `Set<String>` |
| `getParent()` | `TicketSystem` |
| `getTitle()` | `String` |
| `isOpen()` | `boolean` |
## changing data
You can change data of supported fields through dedicated setters.
Every changed field is flagged as changed.
To persist the changes to the connected space,
you need to call `save()`.
This forms an update request for all flagged fields
and returns a new instance of `Ticket`,
formed off the answer from the connected system.
Below the globally defined setters are listed,
each system implementation is free to offer more.
| method | description |
| :-------------------------------------------------- | :-------------------------------------------------------------- |
| `addAssignee(String)`<br/>`removeAssignee(String)` | adds/removes assignee, check system specific part, what to pass |
| `addLabel(String)` | add label |
| `clearAssignees()` | remove all assignees |
| `open()`<br/>`close()` | opens/closes the ticket |
| `setDescription(String)` | |
| `setLabels(Set<String>)`<br/>`setLabels(String[])` | replace all labels with the passed ones |
| `setTitle(String)` | |
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment