Skip to content

feature/2422 implement onlyPublished optional param to filter retrieved journeys#2445

Merged
JoernBerkefeld merged 23 commits intodevelopfrom
#2422-retrieve-last-published-version
Feb 11, 2026
Merged

feature/2422 implement onlyPublished optional param to filter retrieved journeys#2445
JoernBerkefeld merged 23 commits intodevelopfrom
#2422-retrieve-last-published-version

Conversation

@yuliialikhyt
Copy link
Copy Markdown
Collaborator

@yuliialikhyt yuliialikhyt commented Dec 16, 2025

PR details

What changes did you make? (Give an overview)

Added a new optional parameter for the retrieve function. If --onlyPublished is true, the published version of the journeys is retrieved.

Further details (optional)

...

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • test scripts updated
  • Wiki updated (if applicable)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 16, 2025

Coverage Report

Commit:4f95da3
Base: develop@c314d04

Type Base This PR
Total Statements Coverage  71.02%  71%  (-0.02%)
Total Branches Coverage  70.8%  70.81%  (+0.01%)
Total Functions Coverage  83.71%  83.71%  (+0%)
Total Lines Coverage  71.02%  71%  (-0.02%)
Details (changed files):
File Statements Branches Functions Lines
lib/cli.js  0%  0%  0%  0%
lib/index.js  70.64%  64.98%  77.08%  70.64%
lib/metadataTypes/Journey.js  68.71%  67.2%  96%  68.71%

@yuliialikhyt yuliialikhyt marked this pull request as ready for review December 29, 2025 12:30
@yuliialikhyt
Copy link
Copy Markdown
Collaborator Author

yuliialikhyt commented Dec 29, 2025

Suggested documentation updates


retrieve

Command: mcdev retrieve [business unit] [metadata type] [metadata key] [--like] [--metadata] [--format] [--no-format] [--purge] [--onlyPublished]

...

retrieve only published version of journeys with --onlyPublished option:

This optional parameter can be used with the retrieve command when retrieving journeys. When specified, only published versions of journeys are retrieved. If a journey does not have a published version, no version of that journey is retrieved.

Examples:

mcdev retrieve MyProject/DEV journey --onlyPublished
mcdev r cred/bu -m journey:name:myName --onlyPublished
mcdev r cred/bu journey "key" --onlyPublished

@JoernBerkefeld JoernBerkefeld added c/journey COMPONENT enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story" labels Feb 3, 2026
@JoernBerkefeld JoernBerkefeld added this to the 8.3.0 milestone Feb 3, 2026
@JoernBerkefeld JoernBerkefeld linked an issue Feb 3, 2026 that may be closed by this pull request
@JoernBerkefeld JoernBerkefeld changed the title #2422 implement onlyPublished optional param feature/2422 implement onlyPublished optional param Feb 3, 2026
@JoernBerkefeld JoernBerkefeld changed the title feature/2422 implement onlyPublished optional param feature/2422 implement onlyPublished optional param to filter retrieved journeys Feb 3, 2026
# Conflicts:
#	@types/lib/metadataTypes/Journey.d.ts.map
@JoernBerkefeld
Copy link
Copy Markdown
Contributor

somehow this didnt work. had a look into fixing this but couldnt find a quick one´. do you wanna push it forward or shall I?

@yuliialikhyt
Copy link
Copy Markdown
Collaborator Author

somehow this didnt work. had a look into fixing this but couldnt find a quick one´. do you wanna push it forward or shall I?

Would you be able to take a look on your end? It retrieved only journeys with the status Published when I ran it on my end. Without the filter, it retrieves over 800 journeys. I also looked up by status in the search, I can see only Published status
image

@JoernBerkefeld
Copy link
Copy Markdown
Contributor

ok, now i see the difference:

when i tried this, i did so by trying to retrieve a single journey, specified by name and key respectively. your test did a retrieve without name or key.

mcdev r cred/bu -m journey --onlyPublished # works 
mcdev r cred/bu -m journey:myKey --onlyPublished # does not work
mcdev r cred/bu -m journey:name:myName --onlyPublished # does not work 

@yuliialikhyt yuliialikhyt marked this pull request as draft February 6, 2026 20:35
@yuliialikhyt
Copy link
Copy Markdown
Collaborator Author

yuliialikhyt commented Feb 9, 2026

@JoernBerkefeld I couldn't get the API endpoint to work when the key or the id has been specified. It just ignores the query param and retrieves the latest version. So for single key/id retrieve if the onlyPublished param is enabled, retrieve retrieves all published journeys and then finds the one the user asked for and retrieves that journey version with activities.

mcdev r cred/bu -m journey:name:myName --onlyPublished
mcdev r cred/bu -m journey --onlyPublished
mcdev r cred/bu journey "key" --onlyPublished
mcdev r cred/bu journey "id" --onlyPublished
mcdev r cred/bu -m journey:journey:%23 --onlyPublished
mcdev r cred/bu -m journey:journey:%23/ --onlyPublished (disregards the version and retrieves the published version)

@yuliialikhyt yuliialikhyt marked this pull request as ready for review February 9, 2026 21:20
@JoernBerkefeld JoernBerkefeld self-requested a review February 10, 2026 17:30
Copy link
Copy Markdown
Contributor

@JoernBerkefeld JoernBerkefeld left a comment

Choose a reason for hiding this comment

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

few minor changes - i took the liberty of providing commit-ready options for you.

fyi: i removed the inline /** @type {object} */ because it wasnt flagged on my computer as missing when i tried removing it locally - and it didnt add much value.

Comment thread lib/cli.js
Comment thread lib/metadataTypes/Journey.js Outdated
Comment thread lib/metadataTypes/Journey.js Outdated
Comment thread lib/metadataTypes/Journey.js Outdated
Comment thread lib/metadataTypes/Journey.js Outdated
Comment thread lib/metadataTypes/Journey.js Outdated
Comment thread lib/metadataTypes/Journey.js Outdated
Comment thread lib/metadataTypes/Journey.js Outdated
Comment thread lib/metadataTypes/Journey.js Outdated
Comment thread test/type.journey.test.js
yuliialikhyt and others added 11 commits February 10, 2026 21:51
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
Co-authored-by: Jörn Berkefeld <JoernBerkefeld@users.noreply.github.com>
@JoernBerkefeld
Copy link
Copy Markdown
Contributor

Thank you for your good work & effort @yuliialikhyt ❤️

@JoernBerkefeld JoernBerkefeld merged commit 64ecc77 into develop Feb 11, 2026
9 checks passed
@JoernBerkefeld JoernBerkefeld deleted the #2422-retrieve-last-published-version branch February 11, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/journey COMPONENT enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Retrieve last published version of the journeys

2 participants