post function for edit

Stefan Niedermann July 18, 2013

is it possible to set validators and post functions for "edit"?

we're currently using minyaa for this, but we plan to go to jira 6 and want to disable the minyaa-plug-in.

3 answers

0 votes
Alex Perez
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.
July 18, 2013

Hi Stefan,

Another possibility is modifying your workflow and permission schemes to NOT allow edit at all. And, only in certain status, create a self-transition called Edit (rstricted to role), using a screen containing all your "editable" fields.

This way, end-users only notice that the Edit button is in another position, and the edit in the issue screen doesn't work. The good news are that the Edit became a transition, so you can add all your validators ...

HTH

Stefan Niedermann July 18, 2013

yeah, see my comment on the other answer ;-)

but you know, customers/users... "ugh, the button is not where i expected it!!" :D

Alex Perez
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.
July 18, 2013

Just noticed your comments. You posted them while I was editing mine XD

0 votes
RambanamP
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.
July 18, 2013

as of now not possible to configure validator for edit operation but you can do this by JavaScript

try with this

<script type="text/javascript">
jQuery(document).ready( function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {
    callValidateFunction();
});
callValidateFunction();
function callValidateFunction(){
    $('#edit-issue-submit, #issue-edit-submit').click(function() {
        var field=document.getElementById('customfield_13786');//chang customfield id
        if(field !=null && field.value == ''){
        alert("Please Enter Field Value..")://change lert message as per your requirement
        return false;
        }
     
    });
 
}
});
 
</script>

check this post
https://answers.atlassian.com/questions/189606/how-to-make-custom-field-require-on-edit-screen?page=1#comment-190232

Stefan Niedermann July 18, 2013

well, we made very bad experience with inline-editing and javascript...

so we would have to rewrite our plug-in to javascript, and we would have to call the webservice via js....

not the best solution...

at the moment, we're thinking about removing the affected fields from the screen and make a transition to itself with the fields as pop-up. so we can use validators...

not the best solution, too... :D

RambanamP
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.
July 18, 2013

as you said "we're thinking about removing the affected fields from the screen and make a transition to itself with the fields as pop-up. so we can use validators"

it is a good solution, i agree that!!

0 votes
Alex Perez
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.
July 18, 2013

Edit is not a transition, but operation. So you can't assign validator/condition/post/functions to this. You can do something by configuring the Field Configuration Scheme (make fields mandatory), or registering listeners to the edit event ...

However I don-t know if this is still true for Jira 6.x

Can you explain what kind of validators or postfunctions want to setup?

HTH

Stefan Niedermann July 18, 2013

I have a self-written plug-in which takes a field-value, checks if it's ok (it asks a webservice in the background) and then it throws a error message or it let pass.

Suggest an answer

Log in or Sign up to answer