Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cant turn off auto assignment -Agile workflow -server version 8.13.6

Troy E
July 18, 2022

Question, We have a Agile project workflow and the Project admin keeps getting the Bugs assigned to her automatically when they transition

From Bug> QA>Development   

I checked the components that is linked to the type of BUG and turned off the project lead to "Unassigned "

checked the project default is not set to assign to anyone

checked the Post functions in the Bug and other workflows used by the project, I see 7 items but can't change any and don't want to add anything since it affects 51 projects 

I can't see any automation tab or custom fields (smart tags ) 

where else can this be coming from ?

thanks in advance 

(I have admin rights to the project )

the person getting the auto assignments is the project admin but not the project lead 

Screenshot 2022-07-18 105519.png

3 answers

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 Champions.
July 2, 2013
try with the following code, it is working for me

CustomField customField1 = customFieldManager.getCustomFieldObject("customfield_13961"); FieldLayoutManager fieldLayoutManager = ComponentManager.getInstance().getFieldLayoutManager(); FieldLayout layout = fieldLayoutManager.getFieldLayout(issue.getProjectObject(), issue.getIssueTypeObject().getId()); if (layout.getId() == null) { layout = fieldLayoutManager.getEditableDefaultFieldLayout(); } FieldLayoutItem fieldLayoutItem =layout.getFieldLayoutItem(customField1.getId()); DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder(); Calendar calendar = Calendar.getInstance(); Date today = new java.sql.Timestamp(calendar.getTime().getTime()); issue.setCustomFieldValue(customField1, today); customField1.updateValue(fieldLayoutItem, issue, new ModifiedValue(today,today), issueChangeHolder);

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 Champions.
June 19, 2013

hey! try with the following code

CustomField customField1 = customFieldManager.getCustomFieldObject("customfield_13961");
 FieldLayoutManager fieldLayoutManager = ComponentManager.getInstance().getFieldLayoutManager();
FieldLayout layout = fieldLayoutManager.getFieldLayout(issue.getProjectObject(), issue.getIssueTypeObject().getId());
if (layout.getId() == null) {
     layout = fieldLayoutManager.getEditableDefaultFieldLayout();
}
FieldLayoutItem fieldLayoutItem =layout.getFieldLayoutItem(customField1.getId());
DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder();
issue.setCustomFieldValue(customField1, newValue);
customField1.updateValue(fieldLayoutItem, issue, new ModifiedValue(issue.getCustomFieldValue(customField1),date), issueChangeHolder);

Mani Chellamuthu
Contributor
June 20, 2013

Thanks for your help. I will test it and let you know.

Mani Chellamuthu
Contributor
June 21, 2013

Hi Rambanam,

The code you suggested didn't work.

MutableIssue mIssue = (MutableIssue)issue;
CustomField customField1 = customFieldManager.getCustomFieldObject("customfield_13961");
FieldLayoutManager fieldLayoutManager = ComponentManager.getInstance().getFieldLayoutManager();
FieldLayout layout = fieldLayoutManager.getFieldLayout(issue.getProjectObject(), issue.getIssueTypeObject().getId());
if (layout.getId() == null) {
layout = fieldLayoutManager.getEditableDefaultFieldLayout();
}
FieldLayoutItem fieldLayoutItem =layout.getFieldLayoutItem(customField1.getId());
DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder();
mIssue.setCustomFieldValue(customField1, date);

customField1.updateValue(fieldLayoutItem, issue, new ModifiedValue(mIssue.getCustomFieldValue(customField1),date), issueChangeHolder);

}

Please let me know if you have any other approaches.

Mani Chellamuthu
Contributor
June 26, 2013

It would be very helpful, if anyone could guide me right direction.

Mani Chellamuthu
Contributor
July 1, 2013

I couldn't figure it out. Is there anything to resolve it?

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 Champions.
July 1, 2013

what type of Custom field you are trying to update and what is the error message you are getting/showing on log

Mani Chellamuthu
Contributor
July 1, 2013

Custom field type is Date Picker. There is no error raised. But above code does not create an entry in database.

0 votes
Bhushan Nagaraj
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 Champions.
June 17, 2013

Hi Mani,

Here are the general steps again. You have most of it but you are missing the field.store() . Give it another try

@Override
    public Map<String, Object> getVelocityParameters(final Issue issue,final CustomField field,final FieldLayoutItem fieldLayoutItem) {
        final Map<String, Object> map = super.getVelocityParameters(issue, field, fieldLayoutItem);

        if (issue == null) {
            return map;
        }
        
        DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder();
        
        FieldConfig fieldConfig = field.getRelevantConfig(issue);
        try
            {                                
                field.updateValue(fieldLayoutItem, issue, new ModifiedValue(field.getValue(issue), "My new value"), issueChangeHolder);
                field.store();
            }
            catch(Exception exc)
            {
                //Log error
            }
        return map;
    }

Cheers

Bhushan

Mani Chellamuthu
Contributor
June 17, 2013

Bhushan, thanks for your answer. I tried below code as suggested,

CustomField customField1 = customFieldManager.getCustomFieldObject("customfield_13961");
FieldLayoutItem fieldLayoutItem = ComponentManager.getInstance().getFieldLayoutManager().getFieldLayout(issue).getFieldLayoutItem(customField1);
FieldConfig fieldConfig = customField1.getRelevantConfig(issue);

DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder();
customField1.updateValue(fieldLayoutItem, issue, new ModifiedValue(issue.getCustomFieldValue(customField1),date), issueChangeHolder);
customField1.store();

But it didn't get updated. Do I miss anything?

Mani Chellamuthu
Contributor
June 18, 2013

Any updates would be helpful.

Bhushan Nagaraj
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 Champions.
June 19, 2013

Can you post the full code?

Mani Chellamuthu
Contributor
June 20, 2013

Sure, I will post the code.

Mani Chellamuthu
Contributor
June 21, 2013

Hi Bhushan,

Please find the full code. I excute this code while resolving an issue (CommentAssignIssue.java),

//Get fix version's release date
VersionManager versionManager1 = ComponentManager.getComponent(VersionManager.class);
Version version = versionManager1.getVersion(fixVersions);
Date fixReleaseDate = null;
if (null != version.getReleaseDate()){
fixReleaseDate=version.getReleaseDate();
}
//Get Custom field where fix release date will be set
CustomField customField1 = customFieldManager.getCustomFieldObject("customfield_13961");
FieldLayoutItem fieldLayoutItem = ComponentManager.getInstance().getFieldLayoutManager().getFieldLayout(issue).getFieldLayoutItem(customField1);
FieldConfig fieldConfig = customField1.getRelevantConfig(issue);
DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder();
customField1.updateValue(fieldLayoutItem, issue, new ModifiedValue(issue.getCustomFieldValue(customField1),fixReleaseDate), issueChangeHolder);
customField1.store();
//customFieldManager.updateCustomField(customField1);

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events