Coder Social home page Coder Social logo

Comments (10)

lesstif avatar lesstif commented on June 12, 2024

to bind custom fields is difficulty features and i have no plan at this time.
i'm hoping to you contributing here. :)

from php-jira-rest-client.

MBBanfi avatar MBBanfi commented on June 12, 2024

It seems that it is possible to dynamically create attribute, and it is sent properly right now:
$issueField = new IssueField();
$issueField->customfield_10360 = 'XXX';

Of course the problem is validating field. Maybe having metadata of field could allow to create set of methods to create proper attribute, for example:

$issueField->addCustomField(mixed $fieldData, array $fieldSchema);

Where $fieldSchema is for example:
Array
(
[required] =>
[schema] => Array
(
[type] => string
[custom] => com.atlassian.jira.plugin.system.customfieldtypes:textarea
[customId] => 10360
)

[name] => Acceptance Criteria
[hasDefaultValue] => 
[operations] => Array
    (
        [0] => set
    )

)

Where based on type we can make validation and proper parameter type, and based on customId we can create parameter name.

Do you think it is good idea? If yes then I can create methods as I need custom fields to work and send it to you, so you could add it to the project if you feel it is worthy.

from php-jira-rest-client.

nidup avatar nidup commented on June 12, 2024

@lesstif @MBBanfi any progress on this topic? I'm interested too by custom fields, btw, thank you for the lib!

from php-jira-rest-client.

lesstif avatar lesstif commented on June 12, 2024

really sorry for delayed reply.

i think bind custom fields would be a useful features, but there is no progress yet.

from php-jira-rest-client.

vagovszky avatar vagovszky commented on June 12, 2024

@lesstif cweiske/jsonmapper introduces mapping of "Unknown properties". It can be helpful for you.

/**
 * Handle undefined properties during JsonMapper::map()
 *
 * @param object $object    Object that is being filled
 * @param string $propName  Name of the unknown JSON property
 * @param mixed  $jsonValue JSON value of the property
 *
 * @return void
 */
function setUndefinedProperty($object, $propName, $jsonValue)
{
    $object->{'UNDEF' . $propName} = $jsonValue;
}

$jm = new JsonMapper();
$jm->undefinedPropertyHandler = 'setUndefinedProperty';
$jm->map(...);

from php-jira-rest-client.

lesstif avatar lesstif commented on June 12, 2024

@vagovszky thanks for your comment. i have a plan to implements custom field at next week.

from php-jira-rest-client.

Setitch avatar Setitch commented on June 12, 2024

Lessif - as i wrote before i fixed a bit your library (sorry for so long time before i published it).
It also allows you to set/fetch custom fields. Feel free to use any code there^^

https://github.com/Setitch/php-jira-api-rest-client

from php-jira-rest-client.

lesstif avatar lesstif commented on June 12, 2024

@Setitch i can't access your repository. can you make the PR, please?

from php-jira-rest-client.

Setitch avatar Setitch commented on June 12, 2024

https://github.com/Setitch/php-jira-api-rest-client

I wrote the address wrongly - fixed it now. Sorry for that.

from php-jira-rest-client.

lesstif avatar lesstif commented on June 12, 2024

closed in https://github.com/lesstif/php-jira-rest-client/releases/tag/1.9.0.

from php-jira-rest-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.