cli icon indicating copy to clipboard operation
cli copied to clipboard

ManagePackageLicenses permission cannot be retrieved

Open jfaderanga opened this issue 2 years ago • 10 comments

Summary

Retrieving permission set does not include ManagePackageLicenses permission.

Steps To Reproduce

  • Create a permission set with license of Salesforce or Salesforce API Integration
  • Assign the Manage Package Licenses Permission under System Permissions settings.
  • Click save and retrieve via SF or SFDX CLI

Expected result

  • The permission set that was retrieved should have the ManagePackageLicenses permission in the XML

Actual result

  • The permission set that was retrieved does not have the ManagePackageLicenses permission in the XML

System Information

MAC OS zsh

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.17.14",
  "nodeVersion": "node-v20.9.0",
  "osVersion": "Darwin 23.1.0",
  "rootPath": "/Users/jaysonf/.local/share/sf/client/2.17.14-31db5eb",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.1 (core)",
    "@oclif/plugin-commands 3.0.6 (core)",
    "@oclif/plugin-help 6.0.5 (core)",
    "@oclif/plugin-not-found 3.0.3 (core)",
    "@oclif/plugin-plugins 4.1.7 (core)",
    "@oclif/plugin-search 1.0.6 (core)",
    "@oclif/plugin-update 4.1.3 (core)",
    "@oclif/plugin-version 2.0.6 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.2 (core)",
    "@oclif/plugin-which 3.0.8 (core)",
    "@salesforce/cli 2.17.14 (core)",
    "apex 2.3.20 (core)",
    "auth 2.8.26 (core)",
    "data 2.6.3 (core)",
    "deploy-retrieve 1.20.0 (core)",
    "info 3.0.1 (core)",
    "limits 3.0.1 (core)",
    "login 2.0.1 (core)",
    "marketplace 1.0.2 (core)",
    "org 2.11.8 (core)",
    "packaging 1.27.1 (user)",
    "schema 3.0.1 (core)",
    "settings 2.0.2 (core)",
    "sobject 0.2.15 (core)",
    "source 2.11.0 (core)",
    "telemetry 3.1.0 (core)",
    "templates 55.5.18 (core)",
    "trust 3.0.2 (core)",
    "user 2.3.42 (core)",
    "sfdx-git-delta 5.30.0 (user)",
    "sfpowerkit 6.1.0 (user)"
  ]
}

Additional Information

  • Same issue for sandbox and production environment.
  • The xml file is deployable and updates the permission properly when you manually add the ManagePackageLicenses in the xml.
<userPermissions>
    <enabled>true</enabled>
    <name>ManagePackageLicenses</name>
</userPermissions>
  • CLI Version: @salesforce/cli/2.6.9 darwin-arm64 node-v18.15.0

jfaderanga avatar Nov 23 '23 23:11 jfaderanga

Hello @jfaderanga :wave: It looks like you didn't include the full Salesforce CLI version information in your issue. Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

github-actions[bot] avatar Nov 23 '23 23:11 github-actions[bot]

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

github-actions[bot] avatar Nov 23 '23 23:11 github-actions[bot]

Hello @jfaderanga :wave: None of the versions of sf you shared match the latest release.

Shared: 2.6.9, 2.6.9 Latest: 2.17.14

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

github-actions[bot] avatar Nov 24 '23 00:11 github-actions[bot]

@jfaderanga I don't see that in the metdata API type for PermissionSet. https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_permissionset.htm

What version of the metadata API supports ManagePackageLicenses?

mshanemc avatar Nov 26 '23 23:11 mshanemc

@mshanemc yeah I don't see it in the documentation as well. It works fine on API V59.0 if you manually added it.

<userPermissions>
    <enabled>true</enabled>
    <name>ManagePackageLicenses</name>
</userPermissions>

jfaderanga avatar Nov 26 '23 23:11 jfaderanga

ok, if it deploys than we'll assume it's OK in the API and the docs are hopefully just behind.

Does the command show that it's retrieving v59 metadata (on a v59 connection?). If not, that could be a setting in your sfdx-project.json.

If so, can you you try to do this with some other mdapi tool (for example, workbench)? I'd like to know if the API is not returning properly. You could also try use the mdapi-flavored version of the command --target-metadata-dir and see if that brings it down.

I can tell you that the CLI isn't doing anything "inside" the xml contents on PermissionSet, so if the API is really omitting those, you'll have to open a case to get it fixed.

mshanemc avatar Nov 26 '23 23:11 mshanemc

yes, I tried multiple API version from 55.0 and it's the same output. I also tried the --target-metadata-dir on sf project retrieve start and same, it's not pulling it down..

jfaderanga avatar Nov 27 '23 20:11 jfaderanga

Alrighty. I'll turn this into a bug and assign it to the right team, but cases help with prioritization.

mshanemc avatar Nov 27 '23 21:11 mshanemc

This issue has been linked to a new work item: W-14560382

git2gus[bot] avatar Nov 27 '23 21:11 git2gus[bot]

We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on.

github-actions[bot] avatar Nov 27 '23 21:11 github-actions[bot]