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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Live Field Error as "Live Field not configured for the Project

Hi ,

I have Created a webitem in the issue screen as below 

<web-item name="jiraButton" i18n-name-key="jiraButton.name" key="jiraButton" section="operations-top-level" weight="1">
<description key="jiraButton.description">The jiraButton Plugin</description>
<label key="Create Jira Project"></label>
<link linkId="jira-button-link"/>
<tooltip key="Automatically create a new Jira project with information of the displayed Jira Issue"/>
<conditions type="AND">
<condition class="com.ebmpapst.jira.projectcreator.ProjectVisibleCondition">
<param name="Project-Management">Project Management</param>
</condition>
<condition class="com.ebmpapst.jira.projectcreator.ProjectMemberVisibleCondition">
<param name="Project-members">Projectmembers</param>
</condition>
</conditions>
</web-item>

 

It has related java script file as below 

var baseUrl=window.location.origin;

AJS.$(document).ready(function()
{

AJS.toInit(function () {

AJS.$("#jira-button-link").click(function (eve) {
//eve.preventDefault();

getFunction();
});
});

});

function getFunction()
{
AJS.$.ajax
({

url: ((baseUrl=='http://localhost:2990')?(baseUrl+'/jira'):(baseUrl)) +'/rest/api/2/issue/'+ encodeURI(JIRA.Issue.getIssueKey()),
type: "GET",
timeout: 0,
dataType: 'json',
processData: false,
headers: {
"Content-Type": "application/json; charset=utf-8"
},

success: function (response)
{
console.log(JSON.stringify(response));
// console.log(JSON.stringify(response.fields.assignee.key));
if(response.fields.assignee == null){
alert("Jira project can't be created. Please assign the issue to an active Jira user!");

}
else{

if (!hasProject(response.key.toString())) {
createProject(response.key.toString(), response.fields.summary, response.fields.assignee.name, ((baseUrl == 'http://localhost:2990') ? (baseUrl + '/jira') : (baseUrl)) + '/browse/' + encodeURI(JIRA.Issue.getIssueKey()));
}


}

console.log(((baseUrl=='http://localhost:2990')?(baseUrl+'/jira'):(baseUrl)) +'/browse/'+encodeURI(JIRA.Issue.getIssueKey()));
},

error: function (response)
{
console.log(response);
}

});
}
//This Project checks whether the project already exist
function hasProject(keyValue) {

keyValue = keyValue.replace("-", "");

AJS.$.ajax
({

url: ((baseUrl=='http://localhost:2990')?(baseUrl+'/jira'):(baseUrl)) +'/rest/api/2/project/' + encodeURI(keyValue) ,
type: "GET",
timeout: 0,
dataType: 'json',
processData: false,
headers: {
"Content-Type": "application/json; charset=utf-8"
},

success: function (response) {
console.log(JSON.stringify(response));
alert("Jira project can't be created. Project already exists!");
return true;
},

error: function (response) {
console.log(response);
// alert("Jira project has error in creating ");
return false;

}
});
}

function createProject(keyValue,summary,lead)
{
var originalKeyValue = keyValue;

keyValue = keyValue.replace("-","");
console.log(keyValue);


summary = summary.trim();
console.log(summary);

AJS.$.ajax
({

url: ((baseUrl=='http://localhost:2990')?(baseUrl+'/jira'):(baseUrl)) +'/rest/project-templates/1.0/createshared/'+
((baseUrl=='http://localhost:2990')?('10000'):('13303')),
type: "POST",
timeout: 0,
dataType: 'json',
processData: false,
headers: {
"Content-Type": "application/json; charset=utf-8"
},
data: JSON.stringify({
"key": keyValue,
"name": originalKeyValue+" "+summary,
"lead": lead,
"projectTypeKey": "business"
}),


success: function (response) {
console.log(JSON.stringify(response));
alert("Jira project has been created. Now you will be navigated to the project summary screen.");
window.location.replace(((baseUrl=='http://localhost:2990')?(baseUrl+'/jira'):(baseUrl)) +'/projects/'+ keyValue +'/summary');
},

error: function (response) {
console.log(response);
}
});
}

 

The webitem works only in the view issue screen 

but it dosnot work in the Project view page as this is related to Live Field configuration

 

Please help me in this case 

 

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

How to log work and track time in Jira when a person is part of multiple teams

  The manager’s daily activities include a list of challenges to reach high levels of efficiency for their teams. Part of these challenges is related to how to deal with the worklog systems sin...

68 views 2 1
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you