@leitwerk-dev/jira 0.0.0-stage → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,123 @@
1
- # Temporary Holding Version
1
+ # Jira Data Center
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ## Ticket creation
4
+
5
+ Load `@leitwerk-dev/ticket-creation` and set:
6
+
7
+ ```yaml
8
+ extensions:
9
+ jira:
10
+ ticket_creation:
11
+ enabled: true
12
+ default_labels: [created-by-leitwerk]
13
+ ```
14
+
15
+ `jira_create_issue` discovers creatable projects and non-subtask issue types through
16
+ the paginated REST v2 project/issue-type metadata endpoints (Jira 8.4 and later),
17
+ not the bulk `createmeta` endpoint removed in Jira 9. The configured PAT needs Browse Projects and Create Issues
18
+ permissions. Required custom fields and allowed values are included in the drafting
19
+ context. The draft may supply additional fields by metadata field ID, but cannot
20
+ override its server-pinned project or issue type. Unknown fields and missing required
21
+ values fail without creating an issue. Labels cannot contain spaces; use
22
+ `default_labels: []` to omit defaults. Empty labels are omitted from the create
23
+ payload. A destination whose create screen excludes Labels rejects configured
24
+ default labels before approval; requested labels must also be supported by that
25
+ screen.
26
+
27
+ Ticket descriptions are drafted and reviewed in Markdown. `jira_create_issue`
28
+ converts the approved description to Jira wiki markup before publishing and adds
29
+ its reconciliation marker afterward. Headings, emphasis, links, nested lists,
30
+ tables, quotes and code are supported; code contents remain literal.
31
+
32
+ The normal approval flow supports creation, revision and discard. Snapshots pin the
33
+ installation (including its context path), project ID, project key and issue type.
34
+ Retry reconciliation scans project issues, including closed issues, for the durable
35
+ write marker. Ticket creation defaults to disabled; enabling it requires the ticket
36
+ process to be loaded. `LocalJiraAdapter` is available from the `/testing` export for
37
+ persistent local scenarios.
38
+
39
+ ## Profiles and delivery
40
+
41
+ `@leitwerk-dev/jira` is an opt-in Jira Data Center REST v2 integration. It supports
42
+ paginated discovery and issue/comment reads, including installations below a URL
43
+ context path. Load it with `jira-gitlab-change` to launch coordinated GitLab changes.
44
+
45
+ `jira_get_source_issue` returns `descriptionMarkdown` for Markdown consumers while
46
+ `fields.description` retains the original Jira wiki markup. The shared
47
+ `jiraToMarkdown` and `markdownToJira` converters preserve code and escaped
48
+ delimiters. Unsupported Jira macros remain readable literal text.
49
+
50
+ ```yaml
51
+ extensions:
52
+ jira:
53
+ profiles:
54
+ team:
55
+ base_url: https://jira.example.org/jira
56
+ token: env:JIRA_PAT
57
+ # Optional project ID or key for Settings discovery, in addition to watcher projects:
58
+ project: CLD
59
+ # Optional when Epic Link schema discovery is ambiguous:
60
+ epic_link_field: customfield_10014
61
+ ```
62
+
63
+ Use a server-side personal access token that can read the selected projects and
64
+ write issue labels, remote links and workflow transitions. Comment writes are needed
65
+ only by consumers that post comments. Credentials never enter launch snapshots, worker
66
+ payloads, URLs, or diagnostic response bodies. Redirects are rejected.
67
+
68
+ Settings refresh discovers only projects selected by Jira watchers or the profile's
69
+ optional `project`, and their components, by installation URL and immutable ID.
70
+ The picker also excludes previously discovered components outside those configured
71
+ projects. Their retained settings still resolve through direct links.
72
+ Renaming a project or component preserves its settings. Discovery is explicit;
73
+ executing a process uses its retained bindings.
74
+
75
+ The issue watcher requires explicit project IDs and defaults to 30-second polling.
76
+ Only issues with the configured watcher `label` (default `use-leitwerk`), without `leitwerk-done`, and outside the Done status
77
+ category qualify. Installation URL (including context path) and immutable issue ID
78
+ form the launch deduplication key. Skip labels never launch a process by themselves.
79
+ The consuming process rechecks source eligibility and component mappings at admission.
80
+
81
+ `jiraIssuePolicy` observes plan-bypass and cancellation labels with subscription
82
+ and plan-revision correlation. An unavailable read retains the current policy and
83
+ reports a refresh error. All issue comments and label updates use durable external
84
+ writes. Comments carry reconciliation markers; retries after a lost response find
85
+ the existing comment. Label updates preserve unrelated labels.
86
+
87
+ `jira_ensure_remote_link` creates native Jira links to the current Leitwerk process
88
+ or its pinned merge request. MR link titles use the repository name and MR number.
89
+ Process URLs use `server.base_url`; stable global IDs
90
+ reconcile links after lost responses and restarts. `jira_transition_source_issue`
91
+ discovers an available transition by destination status name for In Progress or
92
+ In Review. Missing or ambiguous transitions and permission failures fail the owning
93
+ turn for generic retry. Replays preserve subsequent human status edits, and planning
94
+ never moves In Review back to In Progress or reopens Done tickets.
95
+
96
+ Issue splitting additionally needs issue creation and create-metadata access.
97
+ `jira-issue-split` supplies its own labeled-issue watcher and reviewed creation workflow.
98
+ Split ticket descriptions use Jira Server/Data Center wiki markup, with readable links.
99
+ The Jira extension also provides shared Markdown rendering and ticket-text checks
100
+ for splitters; reconciliation labels and durable receipts remain independent of
101
+ description text.
102
+ Epic membership uses the configured or schema-discovered Data Center Epic Link field.
103
+ Without that field, ordinary Jira changes remain available without epic wiki membership;
104
+ epic splitting requires the field. Other issues create subtasks using Jira's native
105
+ parent field and do not need Epic Link discovery. Subtask types are identified by
106
+ their metadata flag and ID, not by their display name.
107
+ Ambiguous Epic Link discovery requires an explicit override.
108
+ The [`@leitwerk-dev/wiki` package](../../packages/wiki/README.md) owns wiki tools,
109
+ storage, and browser views. Processes register `jiraWikiSource` as their source
110
+ resolver; it validates installation and immutable issue identity and refreshes the
111
+ shared requirement before wiki calls. It accepts retained `issueId` and legacy
112
+ `epicId` metadata. Jira does not register wiki tools.
113
+
114
+ A durable publication receipt or process binding can retain a wiki topic created by
115
+ another publisher. The topic key must identify the same Jira installation, including
116
+ its context path, and immutable source issue ID. The existing topic and page history
117
+ remain in place; a missing or mismatched topic fails without creating a replacement.
118
+
119
+ Jira read tools use the current process project key and its launch-bound Jira
120
+ profile. `jira_get_source_issue` always reads the launch-pinned source issue;
121
+ `jira_get_issue` reads an explicit `issueKey` or ID, including related issues,
122
+ without accepting credentials or another installation URL. Both return original
123
+ Jira fields and a converted `descriptionMarkdown`.
package/dist/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2026 Leitwerk contributors.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.