Closed fprovot closed 1 year ago
Thank you for the detailed analysis @fprovot ! We'll create an Investigation and then probably a work item to try and address this in a future release.
hey @fprovot,
I am trying to replicate this case, so I am following these steps:
From my Dev Env
Sharing Settings
, and then select Sharing Settings.Opportunities
in the 'Manage sharing settings for' optionsPublic Groups
and All Internal Users
This created me the following /path/to/my-package/sharingRules/Opportunity.sharingRules-meta.xml
file with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
<sharingCriteriaRules>
<fullName>my_sharing_rule</fullName>
<accessLevel>Read</accessLevel>
<label>my sharing rule</label>
<sharedTo>
<allInternalUsers></allInternalUsers>
</sharedTo>
<criteriaItems>
<field>IsClosed</field>
<operation>equals</operation>
<value>True</value>
</criteriaItems>
<includeRecordsOwnedByAll>true</includeRecordsOwnedByAll>
</sharingCriteriaRules>
</SharingRules>
From DevOps Center
'Opportunity.my_sharing_rule | SharingCriteriaRule | ADD'
From the Pipeline
From the Target Stage Environment
Sharing Settings
box, then select Sharing Settings.Opportunities
in the 'Manage sharing settings for' options and in the 'Sharing Rules' sectionAction | Criteria | Shared With | Opportunity
Edit Del | Opportunity: Closed EQUALS True | All Internal Users | Read Only
so I don't see any problem. Could you tell me specifically the steps you followed to try to replicate it?
Hi Andres, So I have done a complete new test as you did, and, as on your side, the promotion succeeded and the sharing rule has been deployed in the target org ! I will try to investigate to find out what happened, if I have still enough information.
In the meantime I apologize for the time consumed on this if it indeed not a bug. I'll keep you informed. Best regards Frederic
hi Frederic,
Absolutely no problem, I'm glad to have helped you.
we are going to close this issue, but if you have problems again feel free to post here again or create a new one with the details.
Regards, Andrés
Finaly all I can say for sure is that
sfdx force:source:deploy --manifest=package.xml
doesn't work (for me) with object of type SharingCriteriaRule, with error
"An object 'Opportunity.TEST_OPP_SHARING_RULE' of type SharingCriteriaRule was named in package.xml, but was not found in zipped directory"
Package.xml used :
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Opportunity.TEST_OPP_SHARING_RULE</members>
<name>SharingCriteriaRule</name>
</types>
<version>56.0</version>
</Package>
I think this is not an issue for you and your team, but regarding the CLI. Can you transmit it to the correct team? Thanks
hey @fprovot,
I opened this issue W-12386328
to the team owner
Describe the bug DEVOPS Promotion successfull, but missing metadata in the target org
To Reproduce Steps to reproduce the behavior:
Expected behavior Sharing rule created or updated.
Analyse done
DEVOPS, to promote the WI, creates a package.xml file using sfdx commands. If there is a sharing rule in the list, it uses the subtype of the sharing type like "SharingCriteriaRule:Opportunity.PKG_SAL_ALL_ALL_RW_for_Parking_Users" which creates in the package.xml this content :
_( command to create the package is visible in the sf_devopsAsync_Operation_Resultc table:
sfdx force:source:manifest:create --manifesttype=package -m "SharingCriteriaRule:Opportunity.PKG_SAL_ALL_ALL_RW_for_Parking_Users"
)_To debug, I created a package.xml file using this command, trying to deploy manualy the branch content to my sandbox. But then when deploying with this in vscode using sfdx command "deploy", the result is
An object 'Opportunity.PKG_SAL_ALL_ALL_RW_for_Parking_Users' of type SharingCriteriaRule was named in package.xml, but was not found in zipped directory
After a lot of tests, the solution I found is to use SharingRules keywork instead of SharingCriteriaRule AND to deploy all and not only one named rule.
sfdx force:source:manifest:create --manifesttype=package -m "SharingRules:*"
which generated this in package.xml
Then the update works on the sandbox.
So there is an issue with the promotion of sharing rules.
sfdx version sfdx-cli/7.182.1 win32-x64 node-v18.12.1