Can we use aliases in Live Fields?

salman_kagzi April 25, 2014

I have SIL's that do a lot of backgroud task and to keep them portable I have been using aliases for custom fields.

Now I am required to write some validation (to be more precise, change in set of field required based on another field) and I think live field is what I need here. But I am unable to understand how would I use custom field aliases here. Can someone please provide an example to do this?

Also. Is it possible to attach validation to Issue Created and Issue updated event? Is there an example available for that? (I have not been able to find anything on the JJUPIN or SIL documentation pages.)

1 answer

1 accepted

0 votes
Answer accepted
Radu Dumitriu
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.
April 25, 2014

1. Yes, you should be able to use the aliases in LF. Give it a try :)

Check examples here: http://confluence.kepler-rominfo.com/display/TR/and don't be afraid to mail us directly on jira-support@kepler-rominfo.comif you need specific things.

2. Nope, listeners are fired when postfunction is run (look at the WF). It is too late. You can add validators, though.

salman_kagzi April 26, 2014

Following doesnt work :(

lfWatch(alias1, {alias2, alias3, alias4}, "callback.sil");

Like ichrak.djebrit likes this
salman_kagzi April 26, 2014

Also, I am unable to disbale the createButton in the live field callback script. I have tried:

lfDisable("issue-create-submit");//Using field Id

lfDisable("Create"); // Using field name

My validation script works fine for Edit and Transition pages, but not on create because of this. Any hint?

Florin Manaila
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.
April 27, 2014

Also, I think we missed the submit button on the create screen. I don't see it in the list . As a workaround you can use lfExecuteJs to run some custom javascript that will disable the button.

HTH

salman_kagzi April 27, 2014

Thanks Florin.

1 => I think I had the wrond midset, I was trying to use the aliases as constant and now I realize that. I will try the above apporach.

2 => Okay. I will try to disable it using the id attribute then.

Florin Manaila
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.
April 27, 2014

Not sure if it's just a typo here or the problem, but

lfWatch(alias1, {alias2, alias3, alias4}, "callback.sil");

should be:

lfWatch("alias1", {"alias2", "alias3", "alias4"}, "callback.sil");


salman_kagzi April 27, 2014

@FlorinFurther to the issue with the Create button.

I have created 2 scripts. 1 to disable and another to enable the create button using:

AJS.$('#issue-create-submit').attr('disabled','disabled');

They work fine on a Create Issue page, but fail to work on a Create Issue dialog. So the question now is, does the file added via lfExecuteJS("enable-create.js"); embeded when a Create Issue dialog is loaded?

salman_kagzi April 27, 2014

@FlorinSorry my bad. The button Id's are different between the create page and the create dialog. Just fixed this problem.

Thanks for all help :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events