post function for edit

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

This widget could not be displayed.

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

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.

This widget could not be displayed.

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

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

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!!

This widget could not be displayed.

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

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

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

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

155 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you