Skip to content

[AXON-432] Transition issue from the context menu #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sdzh-atlassian
Copy link
Member

@sdzh-atlassian sdzh-atlassian commented May 29, 2025

What Is This Change?

A small PR to add a way to transition issues right from the ASSIGNED list on the left 😉

There's a new dropdown menu button:
image

Which does this when you click it:
image

If you have fancy transitions, you get a fancy picker! 😁
image

How Has This Been Tested?

M A N U A L L Y (over a rather short period of time 😢 )

Basic checks:

  • npm run lint
  • npm run test

Advanced checks:

  • If Atlassian employee & Bitbucket changes: did you test with DC in mind? See Instructions - Nope, this is very much a quick fix only tested for cloud

Recommendations:

  • Update the CHANGELOG if making a user facing change - TODO

@sdzh-atlassian
Copy link
Member Author

sdzh-atlassian commented May 29, 2025

Remaining stuff:

  • Analytics
  • Changelog
  • More cleanup?

@sdzh-atlassian sdzh-atlassian force-pushed the AXON-432-transition-issue-dropdown branch from a64fee5 to 5e92ced Compare May 30, 2025 01:21
@sdzh-atlassian sdzh-atlassian force-pushed the AXON-432-transition-issue-dropdown branch from 5e92ced to 6607a3b Compare May 30, 2025 01:26
@@ -193,6 +195,33 @@ export function registerCommands(vscodeContext: ExtensionContext) {
commands.executeCommand(Commands.ShowIssue, issueNode.issue),
),
commands.registerCommand(Commands.AssignIssueToMe, (issueNode: IssueNode) => assignIssue(issueNode)),
commands.registerCommand(Commands.TransitionIssue, async (issueNode: IssueNode) => {
const issue = issueNode.issue as MinimalIssue<DetailedSiteInfo>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it check if issue is a MinimalIssue? isMinimalIssue(...)
even inside the IssueNode class it's checked

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the check, but I'm pretty sure it should only ever be a MinimalIssue here 🤔

src/analytics.ts Outdated
issueKey: string,
method?: string,
): Promise<TrackEvent> {
return instanceTrackEvent(site, 'transitioned', 'issue', { actionSubjectId: issueKey, method });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: source instead of method ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cabella-dot and I actually pondered for a bit on what to call this, with source being among the options ;D
Happy to change it to that

FWIW, the rationale I had behind method was because this is describing a transition, and source could possibly refer to the source state of the transition

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some deliberation, ended up on this signature:

export async function transitionIssue(
    issueOrKey: MinimalIssueOrKeyAndSite<DetailedSiteInfo>,
    transition: Transition,
    analyticsData?: {
        source: string;
    },
)


const target = issue.transitions.find((x) => x.name === transition.label);
if (!target) {
window.showErrorMessage(`Transition ${transition.label} not found`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is never supposed to happen since the labels are being built from the same transitions data 😆 but anyway, can you add a Logger.error so we can catch it in telemetry?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need an exception for that? Could you please elaborate a bit on how you'd like this handled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants