Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

cfSetValueWithEventPropagation not propagating?

Edited

I'm not sure where my error is: I am setting a simple Text field (Id = "EpicLink") from javascript using cfSetValueWithEventPropagation. The field sets correctly. However, the rule that is monitoring the EpicLink field is not triggering. The rule does function correctly when the field is adjusted manually, or if the EpicLink field is updated from elsewhere in the form via a standard "Set Value" rule.

The Javascript (This sets EpicLink without error, but the Rule does not trigger):

<script>
function parseAuditDescription(formName, formId) {
const mydebug = true;

const v_AuditDescription = AJS.$(formName).find('#i_AuditDescription').val();

if(mydebug) alert(v_AuditDescription);

const rx_EpicLink = /\|Audited Epic\|(.*?)(?<!\\)\|/;
const val_EpicLink = rx_EpicLink.exec(v_AuditDescription);
if(mydebug) alert("EpicLink[0]: " + val_EpicLink[0]);
if(mydebug) alert("EpicLink[1]: " + val_EpicLink[1]);
if(mydebug) alert("EpicLink[2]: " + val_EpicLink[2]);

cfSetValueWithEventPropagation(formId, 'EpicLink', val_EpicLink[1]);
}
</script>

The Rule (works if EpicLink is modified manually or if EpicLink is modified by a "Set Value" Rule):

Rule for ConfiForms Field Definitions:
Field name: EpicLink
Condition: !EpicLink:[empty]
Action to execute: Lookup and set JIRA issue data
Values to set: EpicFVReleaseDate=fields.fixVersions.releaseDate&EpicSummary=fields.summary&EpicStatus=fields.status.name&EpicFixVersion=fields.fixVersions.name&EpicLabels=fields.labels&EpicComponents=fields.components.name
JIRA Issue Key: [entry.EpicLink]
Application link: XXXX (my Jira instance identifier)
No event propagation on value change: <unchecked>

Thanks in advance...

1 answer

0 votes
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 09, 2023

Hi @Dan 

Indeed this seems to be a bug

Try the following workaround instead

 

AJS.$('#' + formId).find('#i_' + fieldName).each(function () {
processWithSetValue(AJS.$(this), fieldValue, true, false, '', false);
});

So instead of 

cfSetValueWithEventPropagation(formId, 'EpicLink', val_EpicLink[1]);

Have this

AJS.$('#' + formId).find('#i_EpicLink').each(function () {
processWithSetValue(AJS.$(this), val_EpicLink[1], true, false, '', false);
});

Sorry about that, we will fix this little annoyance asap (in 3.7.1)

Alex

Unfortunately, still not propagating. The EpicLink did populate so the alternative syntax worked fine in that regard, but the subsequent rule is still not triggering (unless I update EpicLink manually or via a "Set Value" rule instead of "Run Custom Javascript" rule).

I checked with our enablement team, and they got back to me saying that we're still on 3.6.1. An upgrade to 3.7.0 will be released when confluence is upgraded to 7.13.19 sometime in the next few months (ugh... didn't realize what versions we were at).

Should your workaround function in 3.6.1, or do I need to wait until our 3.7.0 upgrade to deploy this?

Thanks once again for your detailed help :)

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 10, 2023

Sorry about that, a little correction

AJS.$('#' + formId).find('#i_EpicLink').each(function () {
processWithSetValue(AJS.$(this), val_EpicLink[1], true, false, 'input', false);
});

If "EpicLink" is a text field...

Alex 

Like Dan likes this

This worked perfectly - Thank you so much!

Is there documentation on the processWithSetValue function that you can direct me to?

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 13, 2023

This is really a private method, we will ensure the "cfSetValueWithEventPropagation" method is fixed (in the upcoming 3.7.1, with an extra parameter to tell what event to propagate, as in my workaround)

Like Dan likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events