<h2>Workflow Approval Activity is not working properly/getting triggered</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><ul style="list-style-type: square;"><li>For the request item, there's a workflow attached to it.</li><li>IF activity and APPROVAL activity won't work as it stuck at the approval activity.</li></ul></section></div><div ><h3 >Release</h3><section><ul style="list-style-type: square;"><li>Madrid Patch 8.</li></ul></section></div><div ><h3 >Cause</h3><section><ul style="list-style-type: square; list-style-position: inside;"><li>There is a run script activity named 'Run Script' after the begin activity that has the code:<br /> current.u_request_title = current.variables.Require_Access;</li><li>Now in the Approval activity, we are querying using the same field 'u_request_title'</li></ul></section></div><div ><h3 >Resolution</h3><section><ul style="list-style-type: disc; list-style-position: inside;"><li>There is a run script activity named 'Run Script' after the begin activity that has the code:<br /> current.u_request_title = current.variables.Require_Access;</li><li>Now in the Approval activity, we are querying using the same field 'u_request_title' :<br /><br />var mgrAppr = new GlideRecord('u_service_request_lookup');<br />mgrAppr.addQuery('u_request_title', current.u_request_title);<br />mgrAppr.query();<br />if(mgrAppr.next()) {<br />apprRequired = mgrAppr.u_manager_approval_required;<br />}<br />gs.log('Line Manager:- ' + current.u_request_title + ' isreq = ' + apprRequired);</li></ul> <ul style="list-style-type: square;"><li>For the RITM0080601, there is no variable named "Require_Access" and therefore the gliderecord query to the "u_service_request_lookup" table would have searched for 'u_request_title' IS EMPTY and it would not return any result and therefore the value for 'apprRequired' variable is 'False'.</li><li>We can confirm this by looking at the system log from the approval activity:<br />Line Manager:- isreq = false</li><li>We can see that the 'current.u_request_title' is empty as the workflow tries to set the empty value.<br /><br /><br /></li></ul></section></div></article></div>