Repository: dmwm/wmcore
Issue: Broken workflow status transition to assigned

**Impact of the bug**
Reqmgr2

**Describe the bug**
During the [HG2209](https://github.com/dmwm/WMCore/issues/11225) validation we have faced a problem with moving workflows' status from `assignment-approved` to `assigned`. Here [1] is the error we face. This has been found while working with ACDC workflows. The general workflow transition seems to be somehow working because we  do see workflows passing to `running-open`. All the conditions under which the bug reveals itself are currently investigated. So far the clues we have point to the following [PR](https://github.com/dmwm/WMCore/pull/11181/files). 

This bug needs to be resolved before we deploy the new release in production.   

**How to reproduce it**
Submit a workflow with central services version WMCore v.2.1.2.pre3 and try to create  and move an ACDC workflow from `assignment-approved` to  `assigned`.

**Expected behavior**
The workflow status transition to proceed with no errors. 

**Additional context and error message**
[1]
```
[04/Sep/2022:09:10:45] reqmgr2-7689bd755d-p52m8 188.185.14.143 "GET /reqmgr2/data/request?name=spiga_ReReco_339_TB_CMS_Marconi_220731_175607_3091 HTTP/1.1" 200 OK [data: 3936 in 1925 out 26215 us ] [auth: OK "/DC=ch/DC=cern/OU=computers/CN=wmagent/vocms0192.cern.ch" "" ] [ref: "" "WMCore.Services.Requests/v002" ]
[04/Sep/2022:09:10:45]  Updating request "tivanov_ACDC_TaskChain_LumiMask_multiRun_HG2209_Val_220904_091028_2526" with these user-provided args: {'RequestStatus': 'assigned', 'RequestPriority': 200000, 'Team': 'testbed-vocms0192', 'SiteWhitelist': ['T1_US_FNAL', 'T2_CH_CERN'], 'SiteBlacklist': '', 'AcquisitionEra': {'HLTD': 'CMSSW_7_2_0', 'RECODreHLT': 'CMSSW_7_2_0'}, 'ProcessingString': {'HLTD': 'HLTD_TaskChain_LumiMask_multiRun_HG2209_Val_Todor_v1', 'RECODreHLT': 'RECODreHLT_TaskChain_LumiMask_multiRun_HG2209_Val_Todor_v1'}, 'ProcessingVersion': 11, 'Dashboard': 'integration', 'MergedLFNBase': '/store/mc', 'TrustSitelists': 'False', 'UnmergedLFNBase': '/store/unmerged', 'MinMergeSize': 2147483648, 'MaxMergeSize': 4294967296, 'MaxMergeEvents': 100000, 'BlockCloseMaxWaitTime': 72000, 'BlockCloseMaxFiles': 500, 'BlockCloseMaxEvents': 250000000, 'BlockCloseMaxSize': 5000000000000, 'SoftTimeout': 129600, 'GracePeriod': 1000, 'TrustPUSitelists': 'False', 'CustodialSites': '', 'CustodialSubType': '', 'NonCustodialSites': '', 'NonCustodialSubType': '', 'Override': {'eos-lfn-prefix': 'root://eoscms.cern.ch//eos/cms/store/logs/prod/recent/TESTBED'}, 'AutoApproveSubscriptionSites': '', 'SubscriptionPriority': 'Low'}
[04/Sep/2022:09:10:46]  Error: Traceback (most recent call last):
  File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/ReqMgr/Service/Request.py", line 188, in validate
    self._validateRequestBase(param, safe, validate_request_update_args, requestName)
  File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/ReqMgr/Service/Request.py", line 100, in _validateRequestBase
    workload, r_args = valFunc(args, self.config, self.reqmgr_db_service, param)
  File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/ReqMgr/Utils/Validation.py", line 60, in validate_request_update_args
    workload.validateArgumentForAssignment(request_args)
  File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/WMSpec/WMWorkload.py", line 1945, in validateArgumentForAssignment
    validateArgumentsUpdate(schema, argumentDefinition)
  File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/WMSpec/WMWorkloadTools.py", line 292, in validateArgumentsUpdate
    validateUnknownArgs(arguments, argumentDefinition)
  File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/WMSpec/WMWorkloadTools.py", line 323, in validateUnknownArgs
    raise WMSpecFactoryException(msg)
WMCore.WMSpec.WMSpecErrors.WMSpecFactoryException: <@========== WMException Start ==========@>
Exception Class: WMSpecFactoryException
Message: There are unknown/unsupported arguments in your request spec: ['AutoApproveSubscriptionSites', 'NonCustodialSubType', 'CustodialSubType']
        ClassName : None
        ModuleName : WMCore.WMSpec.WMWorkloadTools
        MethodName : validateUnknownArgs
        ClassInstance : None
        FileName : /data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/WMSpec/WMWorkloadTools.py
        LineNumber : 323
        ErrorNr : 0

Traceback: 

<@---------- WMException End ----------@>

[04/Sep/2022:09:10:46]  SERVER REST ERROR WMCore.ReqMgr.DataStructs.RequestError.InvalidSpecParameterValue 53d67b1934bc2cd41f720c7b170dc0e9 (Invalid spec parameter value: There are unknown/unsupported arguments in your request spec: ['AutoApproveSubscriptionSites', 'NonCustodialSubType', 'CustodialSubType'])
[04/Sep/2022:09:10:46]    Traceback (most recent call last):
[04/Sep/2022:09:10:46]      File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/REST/Server.py", line 728, in default
[04/Sep/2022:09:10:46]        return self._call(RESTArgs(list(args), kwargs))
[04/Sep/2022:09:10:46]      File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/REST/Server.py", line 805, in _call
[04/Sep/2022:09:10:46]        v(apiobj, request.method, api, param, safe)
[04/Sep/2022:09:10:46]      File "/data/srv/HG2209c/sw/slc7_amd64_gcc630/cms/reqmgr2/2.1.2.pre3/lib/python3.8/site-packages/WMCore/ReqMgr/Service/Request.py", line 223, in validate
[04/Sep/2022:09:10:46]        raise InvalidSpecParameterValue(msg) from None
[04/Sep/2022:09:10:46]    WMCore.ReqMgr.DataStructs.RequestError.InvalidSpecParameterValue: InvalidSpecParameterValue 53d67b1934bc2cd41f720c7b170dc0e9 [HTTP 400, APP 1102, MSG "Invalid spec parameter value: There are unknown/unsupported arguments in your request spec: ['AutoApproveSubscriptionSites', 'NonCustodialSubType', 'CustodialSubType']", INFO None, ERR None]

```

Changed files:
src/python/WMCore/WMSpec/WMTask.py, src/python/WMCore/ReqMgr/DataStructs/RequestStatus.py, src/python/WMCore/ReqMgr/Web/utils.py, src/python/WMCore/ReqMgr/Web/ReqMgrService.py

diff --git a/src/python/WMCore/ReqMgr/DataStructs/RequestStatus.py b/src/python/WMCore/ReqMgr/DataStructs/RequestStatus.py
index 281dee4e7..68ccde18b 100644
--- a/src/python/WMCore/ReqMgr/DataStructs/RequestStatus.py
+++ b/src/python/WMCore/ReqMgr/DataStructs/RequestStatus.py
@@ -124,9 +124,9 @@ ALLOWED_ACTIONS_FOR_STATUS = {
                             "MaxMergeEvents", "BlockCloseMaxWaitTime",
                             "BlockCloseMaxFiles", "BlockCloseMaxEvents", "BlockCloseMaxSize",
                             "SoftTimeout", "GracePeriod",
-                            "TrustPUSitelists", "CustodialSites", "CustodialSubType",
-                            "NonCustodialSites", "NonCustodialSubType", "Override",
-                            "AutoApproveSubscriptionSites", "SubscriptionPriority"],
+                            "TrustPUSitelists", "CustodialSites",
+                            "NonCustodialSites", "Override",
+                            "SubscriptionPriority"],
     "assigned": ["RequestPriority"],
     "staging": ["RequestPriority"],
     "staged": ["RequestPriority"],
diff --git a/src/python/WMCore/ReqMgr/Web/ReqMgrService.py b/src/python/WMCore/ReqMgr/Web/ReqMgrService.py
index dc6e4b8dd..db5645233 100644
--- a/src/python/WMCore/ReqMgr/Web/ReqMgrService.py
+++ b/src/python/WMCore/ReqMgr/Web/ReqMgrService.py
@@ -293,10 +293,7 @@ def getPropValueMap():
                       'SiteBlacklist': SITE_CACHE.getData(),
                       'SubscriptionPriority': ['Low', 'Normal', 'High'],
                       'CustodialSites': PNN_CACHE.getData(),
-                      'CustodialSubType': ['Move', 'Replica'],
                       'NonCustodialSites': PNN_CACHE.getData(),
-                      'NonCustodialSubType': ['Move', 'Replica'],
-                      'AutoApproveSubscriptionSites': PNN_CACHE.getData(),
                       'MergedLFNBase': lfn_bases(),
                       'UnmergedLFNBase': lfn_unmerged_bases(),
                       'TrustPUSitelists': [True, False],
diff --git a/src/python/WMCore/ReqMgr/Web/utils.py b/src/python/WMCore/ReqMgr/Web/utils.py
index 6357045c0..5ae904772 100644
--- a/src/python/WMCore/ReqMgr/Web/utils.py
+++ b/src/python/WMCore/ReqMgr/Web/utils.py
@@ -95,7 +95,7 @@ def json2table(jsondata, web_ui_map, visible_attrs=None, selected={}):
                         % (key, json.dumps(val))
             else:
 
-                MULTI_SELECTION_KEYS = ['SiteWhitelist', 'SiteBlacklist', 'AutoApproveSubscriptionSites']
+                MULTI_SELECTION_KEYS = ['SiteWhitelist', 'SiteBlacklist']
                 if key in MULTI_SELECTION_KEYS:
                     sel = "<select class=\\"width-100\\" name=\\"%s\\" multiple>" % key
                 else:
diff --git a/src/python/WMCore/WMSpec/WMTask.py b/src/python/WMCore/WMSpec/WMTask.py
index b3c12bd51..249eadf9e 100644
--- a/src/python/WMCore/WMSpec/WMTask.py
+++ b/src/python/WMCore/WMSpec/WMTask.py
@@ -1051,9 +1051,7 @@ class WMTaskHelper(TreeHelper):
         return a dictionary with the following structure
         {<dataset> : {CustodialSites : [],
                       NonCustodialSites : [],
-                      Priority : "Low",
-                      CustodialSubType : "Replica",
-                      NonCustodialSubType : "Replica"
+                      Priority : "Low"
                      }
         }
         """