A parameterized trigger plugin is what you are looking for.
Once you have installed the plugin, see the second screenshot below. Go to the Configure page of your project. Find Build > Add build step > From drop-down menu, select Trigger/call builds on other projects . After that, click Add Parameters > From drop-down menu, select Current build parameters

Above the snapshot is parent task A, where I define a string parameter that will be used in its child task B.

Above the picture, there is again parent task A, where I indicate the descending (child) task B, as well as the inclusion of Current build parameters , which ensures that the parameters defined in the parent task A are visible to the child tasks. Once we are done with these settings, we should be able to see the link to the upstream task in child task B, as shown below. This will confirm that everything is still fine. :)

Now the only task is to use / call the variable (defined in parent task A) in child task B. This is shown in the following snapshot:

I tested it on Windows, so I used %string% .
If you are on a UNIX / Linux machine, select Run Shell and use ${string}
source share