Skip to content
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

unable to deploy sharing rules trought sfdx force:source:deploy command in version 7.82 #833

Closed
dimitrimonge opened this issue Feb 5, 2021 · 9 comments

Comments

@dimitrimonge
Copy link

Summary

Running sfdx force:source:deploy on a sandbox doesn't deploy sharing rules metadata

Steps To Reproduce:

have sharing criteria rules in your local repository

Run sfdx force:source:deploy --manifest path/to/manifest.xml

See no changes.

Expected result

image

Actual result

image

Additional informartion

Deployment of sharing rules is working with sfdx version 7.45

@AllanOricil
Copy link

AllanOricil commented Feb 5, 2021

@dimitrimonge It might be an issue caused by an old version of sfdx. Try to update to the latest version: sfdx-cli/7.84.2-a2868a68d5 win32-x64 node-v12.18.3 and then verify if the bug persists.

@mdonnalley mdonnalley added the more information required Issue requires more information or a response from the customer label Feb 10, 2021
@DougMidgley
Copy link

Hey,
Same issue here using sfdx-cli/7.86.3 win32-x64 node-v15.5.1

=== Deployed Source
No results found

Files are here inside of the following files
-sharingRules
--Account.sharingRules-meta.xml
--Case.sharingRules-meta.xml

pacakge file is

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Account.CSSCZ_AccountSharingRule</members>
        <members>Case.CSSCZ_CaseSharingRule</members>
        <name>SharingCriteriaRule</name>
    </types>
    <version>51.0</version>
</Package>```

@mdonnalley
Copy link
Contributor

@dimitrimonge @DougMidgley could either of you provide a link to a github repo that contains the metadata that replicates this issue?

Thanks

@no-response
Copy link

no-response bot commented Feb 17, 2021

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

@no-response no-response bot closed this as completed Feb 17, 2021
@dimitrimonge
Copy link
Author

@AllanOricil @DougMidgley @mdonnalley sorry for the delay, I was very busy by a go live last days.
I found out a work around to make it work.

You can add the following tag to your manifest :

    <types>
        <members>*</members>
        <name>SharingRules</name>
    </types>

You can have the same issue with matching rule that you can solve with same kind of tag :

    <types>
        <members>*</members>
        <name>MatchingRules</name>
    </types>

Hope will help

Best regards

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Mar 2, 2021
@no-response no-response bot reopened this Mar 2, 2021
@DougMidgley
Copy link

So when using the SharingRules tag it works, but when using SharingCriteriaRule it does not, even though it is supported in the coverage report ( https://developer.salesforce.com/docs/metadata-coverage/51). The metadata docs (https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingrules.htm) are contradictory - they provide an example using the Subtype

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>ObjA__c.*</members>
        <name>SharingCriteriaRule</name>
    </types>
    <types>
        <members>ObjA__c.*</members>
        <name>SharingOwnerRule</name>
    </types>
    <version>51.0</version>
</Package>

but also say it cannot be used

You can’t retrieve, delete, or deploy manual sharing rules or sharing rules by their type (owner, criteria-based, territory, or guest user).

A further discussion can be found here - scolladon/sfdx-git-delta#99 in detail

@dimitrimonge
Copy link
Author

@DougMidgley
it seems working to retrieve metadatas but not to deploy them.
It used to work in version 7.81.

Hope Salesforce will solve this issue soon but at least we have a work arround :

@niv-goldenberg
Copy link

I'm still getting this for SharingCriteriaRule:
sfdx-cli/7.82.1-0 linux-x64 node-v14.16.0
Ubuntu 20.04

The workaround will not work for me, since we build the package automatically as part of our CI/CD process.

Hope that someone in Salesforce can fix it soon...

@DevopsLabsXD
Copy link

I was able to display the sharing setting changes via SFDX, displaying exclusively the object that was required to modify the sharing setting. When displaying the object in the object's meta file, this information travels:

image

On lines 234 and 258 shown in the image is the configuration of the sharing setting within the object

Regards

Nerio Villalobos (DevOps Salesforce & SFI of LabsXD)
labsxd.com

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

No branches or pull requests

7 participants