Jira Image Requests
AWS Lambda proxy that serves Hummingbird Image Request issues from Jira (with DynamoDB caching) and creates Stories/Epics from the catalog request form.
Features
- Public list: GET
/image-requestsreturns all Ready Image Request issues, following Jira search pagination so requests are not hidden by its page limit - Personal request history: Authenticated GET
/my-image-requestsreturns current and historical requests whose Jira contact email matches the signed-in user - Form submit: POST
/image-requestscreates a version Story. An Epic is created only when a second request uses the same image name; later requests reuse that Epic. A first-time name is Story-only. Authenticated submissions immediately appear in My requests as In Triage. - Customer scoring: Writes the Customer criterion on the Epic from paid email domains (placeholder until subscriber login)
- Total scoring: Maintained by Jira Automation from manual triage fields
Prerequisites
- AWS CLI with permissions for Lambda, API Gateway, DynamoDB, SSM, CloudFormation
- Podman or Docker for SAM build
- Jira bot token in SSM (SecureString)
- HUM project custom fields for scoring (see below)
Deployment
make jira-image-requests/build
make jira-image-requests/deploy
Configuration
| Parameter / env | Description |
|---|---|
ResourcePrefix |
Prefix for AWS resource names |
JiraTokenParameter |
SSM parameter name for the Jira API token |
CacheTtlSeconds |
Cache TTL for the public list (default 300) |
CorsAllowOrigin |
Allowed CORS origin |
ScoringCustomerField |
Jira custom field id for Customer (customfield_…); empty skips write |
PaidCustomerDomains |
Comma-separated email domains scored as paid (e.g. acme.com,contoso.com) |
OidcUserinfoUrl |
OIDC userinfo endpoint used to verify the bearer token and resolve email |
SentryDsn |
Optional Sentry DSN |
My requests ownership
The browser sends the signed-in user’s access token when it loads or submits a
personal request. The Lambda resolves that token through OidcUserinfoUrl and
uses a SHA-256 digest of the normalized email as the DynamoDB partition key.
Raw email is not stored in the ownership records.
On the first authenticated load, the service searches every page of Image Request Stories in Jira, verifies the exact contact email from each description, and writes the matching records to DynamoDB. Later loads reconcile Jira again so status and notes remain current. Anonymous submissions remain supported and are associated with the contact email entered in the form.
Every request uses the same /image-requests?request=REQ-<number> URL throughout
its lifecycle. While a request is In Triage, the drawer resolves it only
from the authenticated owner’s personal history. After the team accepts it and
Jira includes it in the public Ready list, the same URL resolves from the public
list for signed-out visitors and other users as well.
Request status projection
The catalog projects Jira workflow states into the following customer-facing state machine. A newly submitted item starts in In Triage. Jira reopen or backlog changes provide the regression paths.
stateDiagram-v2
[*] --> InTriage: form submitted
InTriage --> Submitted: accepted for backlog
InTriage --> Declined: triage declines
Submitted --> InProgress: work starts
Submitted --> Declined: request declined
InProgress --> Delivered: work completes
InProgress --> Declined: work stops
InProgress --> Submitted: returned to backlog
Submitted --> InTriage: Jira resets to new
Delivered --> InProgress: Jira reopens
Declined --> InTriage: Jira reopens for triage
Each DynamoDB ownership record stores the request key, summary, projected
status, submitted and updated timestamps, resolution date, latest public note,
and whether the latest visible change was a status change, note change, or
both. The UI falls back to Request updated when the previous snapshot is not
available or another Jira field changed. Its keys are OWNER#<email digest>
and REQUEST#<Jira key>.
Image request scoring
Triage scores live on the Image Request Epic, not on customer-facing Stories.
Custom fields (HUM Epics)
Create (or map) these fields, then record each customfield_XXXXX id:
| Field | Type / values | Who sets it |
|---|---|---|
| IR Legal | Select: Y / N | Manual |
| IR Competitive | Number (typically 0–1) | Manual |
| IR Marketable | Number | Manual |
| IR Supportability | Number | Manual |
| IR Upstream Health | Number | Manual |
| IR Level of Effort | Number: 3 easy, 2 medium, 1 hard | Manual |
| IR Technical Feasibility | Number: 0 blocking, 1 feasible | Manual |
| IR Portfolio Conflicts | Number: 0 conflict, 1 good | Manual |
| IR Customer | Number: 0 or 1 | Lambda (ScoringCustomerField) |
| IR Total | Number | Jira Automation only |
Gate: Legal must be Y to continue scoring. Competitive, Marketable, and Supportability / Maturity are also expected to be 1 before a meaningful Total (team convention from the triage spreadsheet).
Lambda: Customer criterion
When a POST creates or reuses an Epic (second or later request for a name), the Lambda:
- Loads Stories under the Epic
- Sets Customer to 1 if any submitter email domain is in
PaidCustomerDomains, otherwise 0 - Writes the value to
ScoringCustomerFieldwhen configured
A first request for a name does not create an Epic, so Customer is not written until a second request for that name arrives.
When subscriber login lands, replace the domain list with real subscription status.
Jira Automation: Total and Legal flag
Configure two rules in Jira (Project settings → Automation). Use the real field names/ids from your instance.
Rule 1 — Sum Total when Legal is Y
- Trigger: Field value changed for any of: Competitive, Marketable, Supportability, Upstream Health, Level of Effort, Technical Feasibility, Portfolio Conflicts, Customer (and optionally Legal)
- Condition: Issue type = Epic AND component = Image Request AND IR Legal = Y
- Action: Edit issue → set IR Total to the sum of the numeric criteria (exclude Legal). Example smart value shape:
{{#=}}
{{issue.IR Competitive}} + {{issue.IR Marketable}} + {{issue.IR Supportability}} +
{{issue.IR Upstream Health}} + {{issue.IR Level of Effort}} +
{{issue.IR Technical Feasibility}} + {{issue.IR Portfolio Conflicts}} +
{{issue.IR Customer}}
{{/}}
Use your instance’s smart-value field keys (often customfield_XXXXX).
- Optional action: Remove label
ir-legal-blockedwhen Legal is Y
Rule 2 — Flag when Legal is not Y
- Trigger: IR Legal changed
- Condition: Issue type = Epic AND component = Image Request AND IR Legal is empty OR IR Legal = N
- Actions:
- Clear IR Total (or set to empty)
- Add label
ir-legal-blocked
Jira Automation recalculates Total whenever triage fields change — no webhook or Lambda rescoring path is required.
Development
make jira-image-requests/setup
make test
License
GPL-3.0-or-later